mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-19 16:46:30 +08: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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user