From 68b89788fdeaace756971169b6e173cf01ba4d47 Mon Sep 17 00:00:00 2001 From: Calcitem Date: Sat, 16 May 2020 01:41:03 +0800 Subject: [PATCH] bb: Fix buffer overflow --- src/game/bitboard.cpp | 6 +++--- src/game/bitboard.h | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/game/bitboard.cpp b/src/game/bitboard.cpp index 70c25201..631310a7 100644 --- a/src/game/bitboard.cpp +++ b/src/game/bitboard.cpp @@ -23,10 +23,10 @@ #include "misc.h" uint8_t PopCnt16[1 << 16]; -uint8_t SquareDistance[SQUARE_COUNT][SQUARE_COUNT]; +uint8_t SquareDistance[SQ_32][SQ_32]; -bitboard_t SquareBB[SQUARE_COUNT]; -bitboard_t LineBB[SQUARE_COUNT][SQUARE_COUNT]; +bitboard_t SquareBB[SQ_32]; +bitboard_t LineBB[SQUARE_COUNT][SQ_32]; /// Bitboards::pretty() returns an ASCII representation of a bitboard suitable /// to be printed to standard output. Useful for debugging. diff --git a/src/game/bitboard.h b/src/game/bitboard.h index ab9f8c6e..8bac7f10 100644 --- a/src/game/bitboard.h +++ b/src/game/bitboard.h @@ -72,10 +72,10 @@ constexpr bitboard_t Seat7 = Seat1 << 6; constexpr bitboard_t Seat8 = Seat1 << 7; extern uint8_t PopCnt16[1 << 16]; -extern uint8_t SquareDistance[SQUARE_COUNT][SQUARE_COUNT]; +extern uint8_t SquareDistance[SQ_32][SQ_32]; -extern bitboard_t SquareBB[SQUARE_COUNT]; -extern bitboard_t LineBB[SQUARE_COUNT][SQUARE_COUNT]; +extern bitboard_t SquareBB[SQ_32]; +extern bitboard_t LineBB[SQUARE_COUNT][SQ_32]; inline bitboard_t square_bb(square_t s) {