]> git.sesse.net Git - stockfish/blobdiff - src/thread.cpp
Fix crash when passing a mate/stalemate position
[stockfish] / src / thread.cpp
index b38bdd6ed51e2848fd60770c936d7a80793e427c..2923c07fac52ad9ac105bd318f1c059dffde17c8 100644 (file)
@@ -184,7 +184,8 @@ void ThreadPool::start_thinking(Position& pos, StateListPtr& states,
           || std::count(limits.searchmoves.begin(), limits.searchmoves.end(), m))
           rootMoves.push_back(Search::RootMove(m));
 
-  Tablebases::filter_root_moves(pos, rootMoves);
+  if (!rootMoves.empty())
+      Tablebases::filter_root_moves(pos, rootMoves);
 
   // After ownership transfer 'states' becomes empty, so if we stop the search
   // and call 'go' again without setting a new position states.get() == NULL.