From 7d97ebfe7f2f459ceb9e4e73efb930e26f758cdc Mon Sep 17 00:00:00 2001 From: Marco Costalba Date: Sun, 11 Dec 2011 11:42:16 +0100 Subject: [PATCH] Fix another crash triggered by previous patch It is ok to redirect st pointer to startState, but the latter should be updated with the content pointed by the st of the original position. The bug is hidden when startState and *st are the same as is the case of searching from start position, but as soon as moves are made (as is the case when splitting) the bug leads to a crash. No functional change. Signed-off-by: Marco Costalba --- src/position.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/position.cpp b/src/position.cpp index bf8497cf..66890a5f 100644 --- a/src/position.cpp +++ b/src/position.cpp @@ -100,6 +100,7 @@ CheckInfo::CheckInfo(const Position& pos) { void Position::copy(const Position& pos, int th) { memcpy(this, &pos, sizeof(Position)); + startState = *st; st = &startState; threadID = th; nodes = 0; -- 2.39.2