mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-17 07:36:23 +08: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:
committed by
Marco Costalba
parent
8c2fd2170a
commit
f45eee318b
@@ -303,7 +303,7 @@ namespace {
|
|||||||
|
|
||||||
void id_loop(Position& pos) {
|
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;
|
int depth, prevBestMoveChanges;
|
||||||
Value bestValue, alpha, beta, delta;
|
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) {
|
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;
|
const TTEntry* tte;
|
||||||
int ply = 0;
|
int ply = 0;
|
||||||
Move m = pv[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) {
|
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;
|
const TTEntry* tte;
|
||||||
int ply = 0;
|
int ply = 0;
|
||||||
|
|
||||||
@@ -1683,7 +1683,7 @@ void Thread::idle_loop() {
|
|||||||
|
|
||||||
Threads.mutex.unlock();
|
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);
|
Position pos(*sp->pos, this);
|
||||||
|
|
||||||
std::memcpy(ss-2, sp->ss-2, 5 * sizeof(Stack));
|
std::memcpy(ss-2, sp->ss-2, 5 * sizeof(Stack));
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ typedef uint64_t Bitboard;
|
|||||||
|
|
||||||
const int MAX_MOVES = 192;
|
const int MAX_MOVES = 192;
|
||||||
const int MAX_PLY = 100;
|
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
|
/// A move needs 16 bits to be stored
|
||||||
///
|
///
|
||||||
|
|||||||
Reference in New Issue
Block a user