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

Fix crash when reaching max ply

Bug introduced in 1b7223a53c that
updated the ss base stack without increasing
the dimension.

No functional change.
This commit is contained in:
Tom Vijlbrief 2013-08-19 16:53:06 +02:00 committed by Marco Costalba
parent 8c2fd2170a
commit f45eee318b
2 changed files with 5 additions and 5 deletions

View file

@ -303,7 +303,7 @@ namespace {
void id_loop(Position& pos) {
Stack stack[MAX_PLY_PLUS_3], *ss = stack+2; // To allow referencing (ss-2)
Stack stack[MAX_PLY_PLUS_6], *ss = stack+2; // To allow referencing (ss-2)
int depth, prevBestMoveChanges;
Value bestValue, alpha, beta, delta;
@ -1575,7 +1575,7 @@ moves_loop: // When in check and at SpNode search starts from here
void RootMove::extract_pv_from_tt(Position& pos) {
StateInfo state[MAX_PLY_PLUS_3], *st = state;
StateInfo state[MAX_PLY_PLUS_6], *st = state;
const TTEntry* tte;
int ply = 0;
Move m = pv[0];
@ -1608,7 +1608,7 @@ void RootMove::extract_pv_from_tt(Position& pos) {
void RootMove::insert_pv_in_tt(Position& pos) {
StateInfo state[MAX_PLY_PLUS_3], *st = state;
StateInfo state[MAX_PLY_PLUS_6], *st = state;
const TTEntry* tte;
int ply = 0;
@ -1683,7 +1683,7 @@ void Thread::idle_loop() {
Threads.mutex.unlock();
Stack stack[MAX_PLY_PLUS_3], *ss = stack+2; // To allow referencing (ss-2)
Stack stack[MAX_PLY_PLUS_6], *ss = stack+2; // To allow referencing (ss-2)
Position pos(*sp->pos, this);
std::memcpy(ss-2, sp->ss-2, 5 * sizeof(Stack));

View file

@ -90,7 +90,7 @@ typedef uint64_t Bitboard;
const int MAX_MOVES = 192;
const int MAX_PLY = 100;
const int MAX_PLY_PLUS_3 = MAX_PLY + 3;
const int MAX_PLY_PLUS_6 = MAX_PLY + 6;
/// A move needs 16 bits to be stored
///