]> git.sesse.net Git - stockfish/commitdiff
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)
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

index 01412276ecdaac2594a8063646c5f20402144eea..387c92b01acc2021b2103aaa9b78bfafff281108 100644 (file)
@@ -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
index 4a6d3da583dab2f629527248c6dc8b46ec757bf0..1dc4e1fa572565ca04e9c36f4201baf1be4d624f 100644 (file)
@@ -57,7 +57,6 @@ struct SearchStack {
   Move killers[KILLER_MAX];
   Depth reduction;
   Value eval;
-  EvalInfo* evalInfo;
 
   void init(int ply);
   void initKillers();