]> git.sesse.net Git - stockfish/commit
Fix an off-by-one bug in extract_pv()
authorMarco Costalba <mcostalba@gmail.com>
Fri, 9 Oct 2009 09:04:55 +0000 (10:04 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Fri, 9 Oct 2009 09:04:55 +0000 (10:04 +0100)
commit06a5b602dc32e5dcbb00f32968f1c18004ec93a2
tree7ea33012f96faa88fcabbd4824bf4839920474ad
parentd892063cd34f0e1ca9f36f0514ebe87767120356
Fix an off-by-one bug in extract_pv()

In case we reach ply == PLY_MAX we exit the function
writing

pv[PLY_MAX] = MOVE_NONE;

And because SearchStack is defined as:

struct SearchStack {
  Move pv[PLY_MAX];
  Move currentMove;
  .....

We end up with the unwanted assignment

SearchStack.currentMove = MOVE_NONE;

Fortunatly this is harmless because currentMove is not used where
extarct_pv() is called. But neverthless this is a bug that
needs to be fixed.

Thanks to Uri Blass for spotting out this.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
src/search.h
src/tt.cpp
src/tt.h