]> git.sesse.net Git - stockfish/commitdiff
Fix SearchStack and ply misalignment in RootMoveList
authorMarco Costalba <mcostalba@gmail.com>
Mon, 31 May 2010 17:32:00 +0000 (18:32 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Mon, 31 May 2010 17:33:43 +0000 (18:33 +0100)
In RootMoveList c'tor we call qsearch() with
ply == 1 but SearchStack at 0.

We never noticed before because in qsearch we don't access
previous's ply SearchStack, otherwise we would have got
a nice crash ;-)

This bug is a fall down of previous patch.

No functional change.

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

index 0ac1f364ed70ec743cefe5da1bc7cb55619b540e..739cce0be6f19a0688c2061d2a7b5b7e96ca7b3b 100644 (file)
@@ -2787,7 +2787,7 @@ namespace {
         init_ss_array(ss);
         pos.do_move(cur->move, st);
         moves[count].move = cur->move;
-        moves[count].score = -qsearch<PV>(pos, ss, -VALUE_INFINITE, VALUE_INFINITE, Depth(0), 1, 0);
+        moves[count].score = -qsearch<PV>(pos, ss+1, -VALUE_INFINITE, VALUE_INFINITE, Depth(0), 1, 0);
         moves[count].pv[0] = cur->move;
         moves[count].pv[1] = MOVE_NONE;
         pos.undo_move(cur->move);