1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-04-30 16:53:09 +00:00

Workaround a static data member bug in MSVC

Without this patch MSVC crashes when compiled
in release mode. It survives and works as
expected in debug mode and with gcc and Intel
compilers.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
Marco Costalba 2008-10-12 22:16:10 +01:00
parent 3901affb1d
commit 58c7a5c477
2 changed files with 4 additions and 7 deletions

View file

@ -38,6 +38,7 @@ namespace {
/// Variables /// Variables
MovePicker::MovegenPhase PhaseTable[32];
int MainSearchPhaseIndex; int MainSearchPhaseIndex;
int EvasionsPhaseIndex; int EvasionsPhaseIndex;
int QsearchWithChecksPhaseIndex; int QsearchWithChecksPhaseIndex;
@ -45,8 +46,6 @@ namespace {
} }
// Static array definition
MovePicker::MovegenPhase MovePicker::PhaseTable[32];
//// ////
@ -440,6 +439,9 @@ Move MovePicker::pick_move_from_list() {
return MOVE_NONE; return MOVE_NONE;
} }
MovePicker::MovegenPhase MovePicker::current_move_type() const {
return PhaseTable[phaseIndex];
}
/// MovePicker::init_phase_table() initializes the PhaseTable[], /// MovePicker::init_phase_table() initializes the PhaseTable[],
/// MainSearchPhaseIndex, EvasionPhaseIndex, QsearchWithChecksPhaseIndex /// MainSearchPhaseIndex, EvasionPhaseIndex, QsearchWithChecksPhaseIndex

View file

@ -81,7 +81,6 @@ private:
Move ttMove, mateKiller, killer1, killer2; Move ttMove, mateKiller, killer1, killer2;
Bitboard pinned, dc; Bitboard pinned, dc;
MoveStack moves[256], badCaptures[64]; MoveStack moves[256], badCaptures[64];
static MovegenPhase PhaseTable[32];
bool pvNode; bool pvNode;
Depth depth; Depth depth;
int phaseIndex; int phaseIndex;
@ -99,10 +98,6 @@ private:
/// all pieces which can possibly give discovered check. This bitboard is /// all pieces which can possibly give discovered check. This bitboard is
/// computed by the constructor function. /// computed by the constructor function.
inline MovePicker::MovegenPhase MovePicker::current_move_type() const {
return PhaseTable[phaseIndex];
}
inline Bitboard MovePicker::discovered_check_candidates() const { inline Bitboard MovePicker::discovered_check_candidates() const {
return dc; return dc;
} }