1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-04-29 08:13:08 +00: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:
Marco Costalba 2011-12-11 11:42:16 +01:00
parent 377c406c74
commit 7d97ebfe7f

View file

@ -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;