From 995ccd2f51d32415d5ef6a674554ffb7fc5125d5 Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Tue, 15 Nov 2016 22:03:15 +0100 Subject: [PATCH] Fix a crash issue when traversing PVs. --- src/main.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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()); -- 2.39.2