1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-04-29 16:23:09 +00:00

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 <mcostalba@gmail.com>
This commit is contained in:
Marco Costalba 2010-05-31 18:32:00 +01:00
parent e4e12ed595
commit ee8ccac622

View file

@ -2787,7 +2787,7 @@ namespace {
init_ss_array(ss); init_ss_array(ss);
pos.do_move(cur->move, st); pos.do_move(cur->move, st);
moves[count].move = cur->move; 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[0] = cur->move;
moves[count].pv[1] = MOVE_NONE; moves[count].pv[1] = MOVE_NONE;
pos.undo_move(cur->move); pos.undo_move(cur->move);