]> git.sesse.net Git - stockfish/commit
Fix a crash when 'go' multiple times
authorMarco Costalba <mcostalba@gmail.com>
Sat, 1 Jun 2013 13:45:46 +0000 (15:45 +0200)
committerMarco Costalba <mcostalba@gmail.com>
Sat, 1 Jun 2013 14:19:42 +0000 (16:19 +0200)
commit2a98042c21fa2f3f5630c41a16b91539d7da3b87
tree24e1271774ddf7016ea565a6ade706baf8e286a1
parent46409a7852ae22abf9c32cbcfe3b35f164ae8ec5
Fix a crash when 'go' multiple times

Search is started after setting a position and
issuing UCI 'go' command. Then if we stop the search
and call 'go' again without setting a new position it
is assumed that the previous setup is preserved, but
this is not the case because what happens is that
SetupStates is reset to NULL, leading to a crash as
soon as RootPos.is_draw() is called because st->previous
is now stale.

UCI protocol is not very clear about requiring that a
position is setup always before launching a search,
so here we easy the life of GUI developers assuming
that the current state is preserved after returning
from a 'stop' command.

Bug reported by Gregor Cramer.

No functional change.
src/thread.cpp