mirror of
https://github.com/opelly27/Stockfish.git
synced 2026-05-20 10:57:43 +00:00
5b1316f7bb
In Position we store a pointer to a StateInfo record kept outside of the Position object. When copying a position we copy also that pointer so after the copy we have two Position objects pointing to the same StateInfo record. This can be dangerous so fix by copying also the StateInfo record inside the new Position object and let the new st pointer point to it. This completely detach the copied Position from the original one. Also rename setStartState() as saveState() and clean up the API to state more clearly what the function does. Signed-off-by: Marco Costalba <mcostalba@gmail.com>