mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-21 17:46:26 +08:00
Fix assert with very high score position
In case of a very high material score, we can overflow VALUE_INFINITE. This patch fixes an assert with: position fen 7k/QQQQR3/2B5/4KN1Q/3QQ3/8/8/4R3 b - - 0 1 go depth 1 No functional change. Resolves #546
This commit is contained in:
committed by
Joona Kiiski
parent
a5c76d69c3
commit
3e4fed3a91
@@ -163,7 +163,7 @@ Value Endgame<KXK>::operator()(const Position& pos) const {
|
||||
||(pos.count<BISHOP>(strongSide) && pos.count<KNIGHT>(strongSide))
|
||||
||(pos.count<BISHOP>(strongSide) > 1 && opposite_colors(pos.squares<BISHOP>(strongSide)[0],
|
||||
pos.squares<BISHOP>(strongSide)[1])))
|
||||
result += VALUE_KNOWN_WIN;
|
||||
result = std::min(result + VALUE_KNOWN_WIN, VALUE_MATE_IN_MAX_PLY - 1);
|
||||
|
||||
return strongSide == pos.side_to_move() ? result : -result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user