Wrap all access to LineBB and add assert

This is a non-functional code style change which provides a safe access handler for LineBB.
Also includes an assert in debug mode to verify square correctness.

closes https://github.com/official-stockfish/Stockfish/pull/2719

No functional change
This commit is contained in:
protonspring
2020-06-06 21:25:32 -06:00
committed by Joost VandeVondele
parent 902309020a
commit b0eb5a1ba3
3 changed files with 18 additions and 6 deletions

View File

@@ -276,7 +276,7 @@ namespace {
: attacks_bb<Pt>(s, pos.pieces());
if (pos.blockers_for_king(Us) & s)
b &= LineBB[pos.square<KING>(Us)][s];
b &= line_bb(pos.square<KING>(Us), s);
attackedBy2[Us] |= attackedBy[Us][ALL_PIECES] & b;
attackedBy[Us][Pt] |= b;