]> git.sesse.net Git - stockfish/blobdiff - src/position.h
Avoid misuse of StepAttacksBB for pawns
[stockfish] / src / position.h
index e571048a2883d9404dcd9c3b7d7ba6dd93c012c9..5a07193b9c5e9226986f789977f9b27e22d519fe 100644 (file)
@@ -273,6 +273,7 @@ inline Square Position::castling_rook_square(CastlingRight cr) const {
 
 template<PieceType Pt>
 inline Bitboard Position::attacks_from(Square s) const {
+  assert(Pt != PAWN);
   return  Pt == BISHOP || Pt == ROOK ? attacks_bb<Pt>(s, byTypeBB[ALL_PIECES])
         : Pt == QUEEN  ? attacks_from<ROOK>(s) | attacks_from<BISHOP>(s)
         : StepAttacksBB[Pt][s];