X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fmain.cpp;fp=src%2Fmain.cpp;h=76aca51d2e8f5f13d8178029ab1f4427bbdab0d3;hp=de220eec97a8ae16bf98a85c0c59df3f0b400865;hb=995ccd2f51d32415d5ef6a674554ffb7fc5125d5;hpb=6a47d25cc0f2f8bef3dc6d31911c51bcb940fe4b 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());