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:
parent
97fe0ac777
commit
74203e181d
2 changed files with 0 additions and 5 deletions
|
@ -653,7 +653,6 @@ void SearchStack::init(int ply) {
|
||||||
currentMove = threatMove = MOVE_NONE;
|
currentMove = threatMove = MOVE_NONE;
|
||||||
reduction = Depth(0);
|
reduction = Depth(0);
|
||||||
eval = VALUE_NONE;
|
eval = VALUE_NONE;
|
||||||
evalInfo = NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void SearchStack::initKillers() {
|
void SearchStack::initKillers() {
|
||||||
|
@ -1386,10 +1385,7 @@ namespace {
|
||||||
if (tte && (tte->type() & VALUE_TYPE_EVAL))
|
if (tte && (tte->type() & VALUE_TYPE_EVAL))
|
||||||
staticValue = value_from_tt(tte->value(), ply);
|
staticValue = value_from_tt(tte->value(), ply);
|
||||||
else
|
else
|
||||||
{
|
|
||||||
staticValue = evaluate(pos, ei, threadID);
|
staticValue = evaluate(pos, ei, threadID);
|
||||||
ss[ply].evalInfo = &ei;
|
|
||||||
}
|
|
||||||
|
|
||||||
ss[ply].eval = staticValue;
|
ss[ply].eval = staticValue;
|
||||||
futilityValue = staticValue + futility_margin(depth, 0); //FIXME: Remove me, only for split
|
futilityValue = staticValue + futility_margin(depth, 0); //FIXME: Remove me, only for split
|
||||||
|
|
|
@ -57,7 +57,6 @@ struct SearchStack {
|
||||||
Move killers[KILLER_MAX];
|
Move killers[KILLER_MAX];
|
||||||
Depth reduction;
|
Depth reduction;
|
||||||
Value eval;
|
Value eval;
|
||||||
EvalInfo* evalInfo;
|
|
||||||
|
|
||||||
void init(int ply);
|
void init(int ply);
|
||||||
void initKillers();
|
void initKillers();
|
||||||
|
|
Loading…
Add table
Reference in a new issue