From 32bd6e44f02a8e0c254376ab0791bd82a85d3cfe Mon Sep 17 00:00:00 2001 From: Joona Kiiski Date: Tue, 26 Jan 2010 20:22:51 +0200 Subject: [PATCH] Do not initialize RootPosition at startup Initializing high-level object at startup is very dangerous, because low-level snippets are not yet initialized. For example Position's constructor calls find_checkers() which calls attackers_to() which depends on various global bitboard arrays which are not yet initialized. I think we are lucky not to crash. RootPosition.from_fen(StartPosition); is called immediately after all initializations are made at uci_main_loop() which is the correct behaviour Signed-off-by: Marco Costalba --- src/uci.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/uci.cpp b/src/uci.cpp index 51eb15b6..6fa55912 100644 --- a/src/uci.cpp +++ b/src/uci.cpp @@ -54,7 +54,7 @@ namespace { // The root position. This is set up when the user (or in practice, the GUI) // sends the "position" UCI command. The root position is sent to the think() // function when the program receives the "go" command. - Position RootPosition(StartPosition); + Position RootPosition; // Local functions bool handle_command(const string& command); -- 2.39.2