From: Steinar H. Gunderson Date: Tue, 15 Nov 2016 21:03:15 +0000 (+0100) Subject: Fix a crash issue when traversing PVs. X-Git-Url: https://git.sesse.net/?p=stockfish;a=commitdiff_plain;h=26bd29e45bea7c756550c3c8130ac64ba71375de;ds=inline Fix a crash issue when traversing PVs. --- diff --git a/src/main.cpp b/src/main.cpp index de220eec..76aca51d 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -119,7 +119,9 @@ void HashProbeImpl::ProbeMove(Position* pos, std::deque* setup_states // Follow the PV until we hit an illegal move. std::stack pv; std::set seen; - while (found && is_ok(entry->move())) { + while (found && is_ok(entry->move()) && + pos->pseudo_legal(entry->move()) && + pos->legal(entry->move())) { FillMove(entry->move(), response->add_pv()); if (seen.count(pos->key())) break; pv.push(entry->move());