From: Fabian Fichter Date: Wed, 23 Dec 2020 10:50:49 +0000 (+0100) Subject: Fix undefined behavior for large-board variants X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=afe48d141a52d3f81444ce9fd1934949dc7794a3;p=fairystockfish.git Fix undefined behavior for large-board variants Partly addresses #213. --- diff --git a/src/evaluate.cpp b/src/evaluate.cpp index 8b16477..98b2145 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -550,7 +550,7 @@ namespace { // when the bishop is outside the pawn chain. Bitboard blocked = pos.pieces(Us, PAWN) & shift(pos.pieces()); - score -= BishopPawns[edge_distance(file_of(s))] * pos.pawns_on_same_color_squares(Us, s) + score -= BishopPawns[edge_distance(file_of(s), pos.max_file())] * pos.pawns_on_same_color_squares(Us, s) * (!(attackedBy[Us][PAWN] & s) + popcount(blocked & CenterFiles)); // Penalty for all enemy pawns x-rayed