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:
@@ -1596,6 +1596,9 @@ bool RootMove::extract_ponder_from_tt(Position& pos)
|
||||
|
||||
assert(pv.size() == 1);
|
||||
|
||||
if (!pv[0])
|
||||
return false;
|
||||
|
||||
pos.do_move(pv[0], st, pos.gives_check(pv[0]));
|
||||
TTEntry* tte = TT.probe(pos.key(), ttHit);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user