From: Marco Costalba Date: Sun, 12 Oct 2008 21:16:10 +0000 (+0100) Subject: Workaround a static data member bug in MSVC X-Git-Url: https://git.sesse.net/?p=stockfish;a=commitdiff_plain;h=58c7a5c4775f7efa333bb2c921583ffba301f6b2;ds=inline 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 --- diff --git a/src/movepick.cpp b/src/movepick.cpp index a18c4692..4d2d3116 100644 --- a/src/movepick.cpp +++ b/src/movepick.cpp @@ -38,6 +38,7 @@ namespace { /// Variables + MovePicker::MovegenPhase PhaseTable[32]; int MainSearchPhaseIndex; int EvasionsPhaseIndex; 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; } +MovePicker::MovegenPhase MovePicker::current_move_type() const { + return PhaseTable[phaseIndex]; +} /// MovePicker::init_phase_table() initializes the PhaseTable[], /// MainSearchPhaseIndex, EvasionPhaseIndex, QsearchWithChecksPhaseIndex diff --git a/src/movepick.h b/src/movepick.h index 10f0e8ef..df2012fe 100644 --- a/src/movepick.h +++ b/src/movepick.h @@ -81,7 +81,6 @@ private: Move ttMove, mateKiller, killer1, killer2; Bitboard pinned, dc; MoveStack moves[256], badCaptures[64]; - static MovegenPhase PhaseTable[32]; bool pvNode; Depth depth; int phaseIndex; @@ -99,10 +98,6 @@ private: /// all pieces which can possibly give discovered check. This bitboard is /// computed by the constructor function. -inline MovePicker::MovegenPhase MovePicker::current_move_type() const { - return PhaseTable[phaseIndex]; -} - inline Bitboard MovePicker::discovered_check_candidates() const { return dc; }