From: Marco Costalba Date: Mon, 8 Feb 2010 09:48:58 +0000 (+0100) Subject: Retire EvalInfo* in SearchStack X-Git-Url: https://git.sesse.net/?p=stockfish;a=commitdiff_plain;h=74203e181d3cbd3ad38125062ee023b842ed0151 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 --- diff --git a/src/search.cpp b/src/search.cpp index 01412276..387c92b0 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -653,7 +653,6 @@ void SearchStack::init(int ply) { currentMove = threatMove = MOVE_NONE; reduction = Depth(0); eval = VALUE_NONE; - evalInfo = NULL; } void SearchStack::initKillers() { @@ -1386,10 +1385,7 @@ namespace { if (tte && (tte->type() & VALUE_TYPE_EVAL)) staticValue = value_from_tt(tte->value(), ply); else - { staticValue = evaluate(pos, ei, threadID); - ss[ply].evalInfo = &ei; - } ss[ply].eval = staticValue; futilityValue = staticValue + futility_margin(depth, 0); //FIXME: Remove me, only for split diff --git a/src/search.h b/src/search.h index 4a6d3da5..1dc4e1fa 100644 --- a/src/search.h +++ b/src/search.h @@ -57,7 +57,6 @@ struct SearchStack { Move killers[KILLER_MAX]; Depth reduction; Value eval; - EvalInfo* evalInfo; void init(int ply); void initKillers();