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

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>
This commit is contained in:
Marco Costalba 2010-02-08 10:48:58 +01:00
parent 97fe0ac777
commit 74203e181d
2 changed files with 0 additions and 5 deletions

View 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

View file

@ -57,7 +57,6 @@ struct SearchStack {
Move killers[KILLER_MAX];
Depth reduction;
Value eval;
EvalInfo* evalInfo;
void init(int ply);
void initKillers();