1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-07-11 19:49:14 +00: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:
Mira 2016-11-06 15:20:23 +01:00 committed by Marco Costalba
parent 0fa80c9ba3
commit dc4655e1f9

View file

@ -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;