]> git.sesse.net Git - stockfish/commit
Retire EvalInfo* in SearchStack
authorMarco Costalba <mcostalba@gmail.com>
Mon, 8 Feb 2010 09:48:58 +0000 (10:48 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Mon, 8 Feb 2010 09:50:17 +0000 (10:50 +0100)
commit74203e181d3cbd3ad38125062ee023b842ed0151
treedd1b0ee0277f155854d3a6d7d253bff769327652
parent97fe0ac77737bfd97b8d53acacb71d38af3020e6
Retire EvalInfo* in SearchStack

It is an hidden bug waiting to fire. The main problem is
that ss[ply] is overwritten by search() and qsearch() called
from IID and razoring, so that we cannot hold a pointer to a
local EvalInfo variable.

For instance if we go razoring then we overwrite the pointer
with the address of a variable local to qsearch(), when we return
from qsearch() variable goes out of scope and now ss[ply].evalInfo
holds a stale pointer !

Because we are not looking for troubles we go through the
safe route and we remove it entirely.

No functional change.

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