diff --git a/src/position.cpp b/src/position.cpp index 18f4978d..abe24a52 100644 --- a/src/position.cpp +++ b/src/position.cpp @@ -777,6 +777,8 @@ bool Position::move_gives_check(Move m, const CheckInfo& ci) const { void Position::do_setup_move(Move m) { + assert(move_is_ok(m)); + StateInfo newSt; // Update the number of full moves after black's move diff --git a/src/uci.cpp b/src/uci.cpp index cc3a271d..673d6618 100644 --- a/src/uci.cpp +++ b/src/uci.cpp @@ -120,6 +120,7 @@ namespace { void set_position(Position& pos, UCIParser& up) { + Move m; string token, fen; up >> token; // operator>>() skips any whitespace @@ -139,8 +140,8 @@ namespace { else return; // Parse move list (if any) - while (up >> token) - pos.do_setup_move(move_from_uci(pos, token)); + while (up >> token && (m = move_from_uci(pos, token)) != MOVE_NONE) + pos.do_setup_move(m); }