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:
Marco Costalba
2016-09-24 07:30:37 +02:00
parent 28240d375c
commit 8662bdfa12
3 changed files with 13 additions and 2 deletions

View File

@@ -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);