]> git.sesse.net Git - stockfish/blobdiff - src/uci.cpp
Detach the state when copying a position
[stockfish] / src / uci.cpp
index a64520050f084e481cc2804aba1dec5406f21c66..4a333f70b7540b2d660070bf6579cfaafaa5cc50 100644 (file)
@@ -210,9 +210,9 @@ namespace {
                 if (RootPosition.rule_50_counter() == 0)
                     RootPosition.reset_game_ply();
             }
-            // Our StateInfo st is about going out of scope,
-            // so save its content before they disappear.
-            RootPosition.setStartState(st);
+            // Our StateInfo st is about going out of scope so copy
+            // its content inside RootPosition before they disappear.
+            RootPosition.saveState();
         }
     }
   }