]> git.sesse.net Git - stockfish/commitdiff
Fix an assert when we stop the search
authorMarco Costalba <mcostalba@gmail.com>
Wed, 24 Oct 2012 22:07:16 +0000 (00:07 +0200)
committerMarco Costalba <mcostalba@gmail.com>
Wed, 24 Oct 2012 22:07:59 +0000 (00:07 +0200)
When signal 'stop' is raised we return bestValue
that could be still set at -VALUE_INFINITE and
this triggers an assert. Fix it by returning
a value we know for sure is not +-VALUE_INFINITE.

Reported by 平岡拓也 Hiraoka.

No functional change.

src/search.cpp

index b43ebd02ab848ae4f2675bd0eaba637b8f9532b8..4ac944029fa8d1b02bf2086b545560e8b79808e2 100644 (file)
@@ -958,7 +958,7 @@ split_point_start: // At split points actual search starts from here
       // ran out of time. In this case, the return value of the search cannot
       // be trusted, and we don't update the best move and/or PV.
       if (Signals.stop || thisThread->cutoff_occurred())
       // ran out of time. In this case, the return value of the search cannot
       // be trusted, and we don't update the best move and/or PV.
       if (Signals.stop || thisThread->cutoff_occurred())
-          return bestValue;
+          return value; // To avoid returning VALUE_INFINITE
 
       if (RootNode)
       {
 
       if (RootNode)
       {