mirror of
https://github.com/peterosterlund2/droidfish.git
synced 2025-04-02 18:30:44 +02:00
Fix stockfish crash.
Merge commit 4e2bb8fa44fe03a2fdb2d3448ac93986354bf9ae from https://github.com/official-stockfish.
This commit is contained in:
parent
7c660323f0
commit
1fd3492edd
@ -303,6 +303,7 @@ void MainThread::search() {
|
|||||||
void Thread::search() {
|
void Thread::search() {
|
||||||
|
|
||||||
Stack stack[MAX_PLY+7], *ss = stack+4; // To reference from (ss-4) to (ss+2)
|
Stack stack[MAX_PLY+7], *ss = stack+4; // To reference from (ss-4) to (ss+2)
|
||||||
|
Move pv[MAX_PLY+1];
|
||||||
Value bestValue, alpha, beta, delta;
|
Value bestValue, alpha, beta, delta;
|
||||||
Move lastBestMove = MOVE_NONE;
|
Move lastBestMove = MOVE_NONE;
|
||||||
Depth lastBestMoveDepth = DEPTH_ZERO;
|
Depth lastBestMoveDepth = DEPTH_ZERO;
|
||||||
@ -314,6 +315,7 @@ void Thread::search() {
|
|||||||
std::memset(ss-4, 0, 7 * sizeof(Stack));
|
std::memset(ss-4, 0, 7 * sizeof(Stack));
|
||||||
for (int i = 4; i > 0; i--)
|
for (int i = 4; i > 0; i--)
|
||||||
(ss-i)->continuationHistory = &this->continuationHistory[NO_PIECE][0]; // Use as sentinel
|
(ss-i)->continuationHistory = &this->continuationHistory[NO_PIECE][0]; // Use as sentinel
|
||||||
|
ss->pv = pv;
|
||||||
|
|
||||||
bestValue = delta = alpha = -VALUE_INFINITE;
|
bestValue = delta = alpha = -VALUE_INFINITE;
|
||||||
beta = VALUE_INFINITE;
|
beta = VALUE_INFINITE;
|
||||||
@ -758,8 +760,9 @@ namespace {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Step 7. Razoring (~2 Elo)
|
// Step 7. Razoring (~2 Elo)
|
||||||
if ( depth < 2 * ONE_PLY
|
if ( !rootNode // The required rootNode PV handling is not available in qsearch
|
||||||
&& eval <= alpha - RazorMargin)
|
&& depth < 2 * ONE_PLY
|
||||||
|
&& eval <= alpha - RazorMargin)
|
||||||
return qsearch<NT>(pos, ss, alpha, beta);
|
return qsearch<NT>(pos, ss, alpha, beta);
|
||||||
|
|
||||||
improving = ss->staticEval >= (ss-2)->staticEval
|
improving = ss->staticEval >= (ss-2)->staticEval
|
||||||
|
Loading…
x
Reference in New Issue
Block a user