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>
void Position::copy(const Position& pos, int th) {
memcpy(this, &pos, sizeof(Position));
+ startState = *st;
st = &startState;
threadID = th;
nodes = 0;