From: Marco Costalba Date: Mon, 31 May 2010 17:32:00 +0000 (+0100) Subject: Fix SearchStack and ply misalignment in RootMoveList X-Git-Url: https://git.sesse.net/?p=stockfish;a=commitdiff_plain;h=ee8ccac622227f3b5184e294ffa3d2766bf4b600 Fix SearchStack and ply misalignment in RootMoveList 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 --- diff --git a/src/search.cpp b/src/search.cpp index 0ac1f364..739cce0b 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -2787,7 +2787,7 @@ namespace { init_ss_array(ss); pos.do_move(cur->move, st); moves[count].move = cur->move; - moves[count].score = -qsearch(pos, ss, -VALUE_INFINITE, VALUE_INFINITE, Depth(0), 1, 0); + moves[count].score = -qsearch(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);