mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-18 08:07:08 +08:00
Fix some asserts unhidden by a debug compile
Fallback form previous patches. No functional change. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
@@ -1199,7 +1199,7 @@ void Position::undo_move(Move m) {
|
|||||||
|
|
||||||
if (st->capture)
|
if (st->capture)
|
||||||
{
|
{
|
||||||
assert(capture != KING);
|
assert(st->capture != KING);
|
||||||
|
|
||||||
// Replace the captured piece
|
// Replace the captured piece
|
||||||
set_bit(&(byColorBB[them]), to);
|
set_bit(&(byColorBB[them]), to);
|
||||||
@@ -1348,7 +1348,7 @@ void Position::undo_promotion_move(Move m) {
|
|||||||
|
|
||||||
if (st->capture)
|
if (st->capture)
|
||||||
{
|
{
|
||||||
assert(capture != KING);
|
assert(st->capture != KING);
|
||||||
|
|
||||||
// Insert captured piece:
|
// Insert captured piece:
|
||||||
set_bit(&(byColorBB[them]), to);
|
set_bit(&(byColorBB[them]), to);
|
||||||
@@ -1358,7 +1358,7 @@ void Position::undo_promotion_move(Move m) {
|
|||||||
|
|
||||||
// Update material. Because the move is a promotion move, we know
|
// Update material. Because the move is a promotion move, we know
|
||||||
// that the captured piece cannot be a pawn.
|
// that the captured piece cannot be a pawn.
|
||||||
assert(capture != PAWN);
|
assert(st->capture != PAWN);
|
||||||
npMaterial[them] += piece_value_midgame(st->capture);
|
npMaterial[them] += piece_value_midgame(st->capture);
|
||||||
|
|
||||||
// Update piece list
|
// Update piece list
|
||||||
@@ -1389,7 +1389,7 @@ void Position::undo_ep_move(Move m) {
|
|||||||
Square to = move_to(m);
|
Square to = move_to(m);
|
||||||
Square capsq = (us == WHITE)? (to - DELTA_N) : (to - DELTA_S);
|
Square capsq = (us == WHITE)? (to - DELTA_N) : (to - DELTA_S);
|
||||||
|
|
||||||
assert(to == ep_square());
|
assert(to == st->previous->epSquare);
|
||||||
assert(relative_rank(us, to) == RANK_6);
|
assert(relative_rank(us, to) == RANK_6);
|
||||||
assert(piece_on(to) == piece_of_color_and_type(us, PAWN));
|
assert(piece_on(to) == piece_of_color_and_type(us, PAWN));
|
||||||
assert(piece_on(from) == EMPTY);
|
assert(piece_on(from) == EMPTY);
|
||||||
|
|||||||
Reference in New Issue
Block a user