mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-20 09:06:45 +08:00
Fix out-of-bound array access printing ponder move
It is possible that we won't have a ponder move if our PV is too short. In that case, just don't print a ponder move. No functional change Resolves #130
This commit is contained in:
@@ -217,9 +217,12 @@ void Search::think() {
|
|||||||
RootPos.this_thread()->wait_for(Signals.stop);
|
RootPos.this_thread()->wait_for(Signals.stop);
|
||||||
}
|
}
|
||||||
|
|
||||||
sync_cout << "bestmove " << UCI::format_move(RootMoves[0].pv[0], RootPos.is_chess960())
|
sync_cout << "bestmove " << UCI::format_move(RootMoves[0].pv[0], RootPos.is_chess960());
|
||||||
<< " ponder " << UCI::format_move(RootMoves[0].pv[1], RootPos.is_chess960())
|
|
||||||
<< sync_endl;
|
if (RootMoves[0].pv.size() > 1)
|
||||||
|
std::cout << " ponder " << UCI::format_move(RootMoves[0].pv[1], RootPos.is_chess960());
|
||||||
|
|
||||||
|
std::cout << sync_endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user