mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-18 08:07:08 +08:00
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 <mcostalba@gmail.com>
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user