mirror of
https://github.com/official-stockfish/Stockfish.git
synced 2026-07-22 12:47:08 +00:00
Fix assert
the assert checks for `bestThreadDecisive && newThreadDecisive`. However `newThreadDecisive` is not guaranteed at this point, leading to assertion failures. This PR rearranges the conditions to ensure correctness. closes https://github.com/official-stockfish/Stockfish/pull/6716 No functional change
This commit is contained in:
committed by
Joost VandeVondele
parent
bb4eb04a50
commit
b63bd7b78e
+5
-3
@@ -394,12 +394,14 @@ Thread* ThreadPool::get_best_thread() const {
|
||||
|
||||
if (bestThreadDecisive)
|
||||
{
|
||||
assert((is_win(bestThreadScore) && is_win(newThreadScore))
|
||||
|| (is_loss(bestThreadScore) && is_loss(newThreadScore)));
|
||||
|
||||
// Make sure we pick the shortest mate / TB conversion.
|
||||
if (newThreadDecisive && std::abs(newThreadScore) > std::abs(bestThreadScore))
|
||||
{
|
||||
assert((is_win(bestThreadScore) && is_win(newThreadScore))
|
||||
|| (is_loss(bestThreadScore) && is_loss(newThreadScore)));
|
||||
|
||||
bestThread = th.get();
|
||||
}
|
||||
}
|
||||
else if (newThreadDecisive
|
||||
|| (!is_loss(newThreadScore)
|
||||
|
||||
Reference in New Issue
Block a user