mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-20 00:56:39 +08:00
Stack offset changed from -5 to -4
Non functional change, tests under sanitizers OK. Rationales for change - Offset in code is in range -4 ... 2 - There was an error by (pathological) corner case MAX_PLY=0 No functional change.
This commit is contained in:
@@ -335,12 +335,12 @@ void MainThread::search() {
|
||||
|
||||
void Thread::search() {
|
||||
|
||||
Stack stack[MAX_PLY+7], *ss = stack+5; // To allow referencing (ss-5) and (ss+2)
|
||||
Stack stack[MAX_PLY+7], *ss = stack+4; // To allow referencing (ss-4) and (ss+2)
|
||||
Value bestValue, alpha, beta, delta;
|
||||
Move easyMove = MOVE_NONE;
|
||||
MainThread* mainThread = (this == Threads.main() ? Threads.main() : nullptr);
|
||||
|
||||
std::memset(ss-5, 0, 8 * sizeof(Stack));
|
||||
std::memset(ss-4, 0, 7 * sizeof(Stack));
|
||||
|
||||
bestValue = delta = alpha = -VALUE_INFINITE;
|
||||
beta = VALUE_INFINITE;
|
||||
|
||||
Reference in New Issue
Block a user