mirror of
https://github.com/sockspls/badfish
synced 2025-05-01 01:03: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:
parent
8c2fd2170a
commit
f45eee318b
2 changed files with 5 additions and 5 deletions
|
@ -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
|
||||||
///
|
///
|
||||||
|
|
Loading…
Add table
Reference in a new issue