From feb17e5acfc6eec264628db7b1531db6fc94a3e4 Mon Sep 17 00:00:00 2001 From: Daniel Monroe Date: Mon, 6 Oct 2025 04:47:37 -0400 Subject: [PATCH] Make sure we don't move a nonexistent piece in SEE added assert. closes https://github.com/official-stockfish/Stockfish/pull/6342 No functional change --- src/position.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/position.cpp b/src/position.cpp index f59632475..d0cad3e7f 100644 --- a/src/position.cpp +++ b/src/position.cpp @@ -1105,6 +1105,8 @@ bool Position::see_ge(Move m, int threshold) const { Square from = m.from_sq(), to = m.to_sq(); + assert(piece_on(from) != NO_PIECE); + int swap = PieceValue[piece_on(to)] - threshold; if (swap < 0) return false;