]> git.sesse.net Git - stockfish/commit
Fix use of an initialized SearchStack
authorMarco Costalba <mcostalba@gmail.com>
Tue, 6 Oct 2009 08:10:42 +0000 (10:10 +0200)
committerMarco Costalba <mcostalba@gmail.com>
Tue, 6 Oct 2009 10:12:41 +0000 (11:12 +0100)
commitda948cc94ebef4988199c90389a5099b087d2088
tree4c2beac731ecff4452800488e66cf8df1e37f807
parente49b21eacb291e8a909afacf3cd2440541be53aa
Fix use of an initialized SearchStack

In RootMoveList c'tor we allocate a search stack and then
call directly qsearch.

There is called init_node() that clears all the fields of the search
stack array that refers to current ply but not the the killer moves.

The killer moves cleared correspond to ply+2.

In id_loop() this is not a problem because killer moves of
corresponding ply are cleared anyway few instructions later,
but in RootMoveList c'tor we leave them uninitialized.

This patch fixes this very old bug. It comes direclty
from Glaurung age.

Bug spotted by Valgrind.

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