mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-20 00:56:39 +08:00
Fix crash when passing a mate/stalemate position
Both Tablebases::filter_root_moves() and extract_ponder_from_tt(9 were unable to handle a mate/stalemate position. Spotted and reported by Dann Corbit. Added some mate/stalemate positions to bench so to early catch this regression in the future. No functional change.
This commit is contained in:
@@ -184,7 +184,8 @@ void ThreadPool::start_thinking(Position& pos, StateListPtr& states,
|
||||
|| std::count(limits.searchmoves.begin(), limits.searchmoves.end(), m))
|
||||
rootMoves.push_back(Search::RootMove(m));
|
||||
|
||||
Tablebases::filter_root_moves(pos, rootMoves);
|
||||
if (!rootMoves.empty())
|
||||
Tablebases::filter_root_moves(pos, rootMoves);
|
||||
|
||||
// After ownership transfer 'states' becomes empty, so if we stop the search
|
||||
// and call 'go' again without setting a new position states.get() == NULL.
|
||||
|
||||
Reference in New Issue
Block a user