]> git.sesse.net Git - stockfish/blobdiff - src/search.cpp
Fix a possible out of range access in previous patch
[stockfish] / src / search.cpp
index 4a2acb62c810684c5eabedb471473b98e86e49e2..ed15902d4838c5800b53fc32a98ae0140e890dce 100644 (file)
@@ -2409,7 +2409,7 @@ namespace {
         // If this thread is the master of a split point and all slaves have
         // finished their work at this split point, return from the idle loop.
         int i = 0;
-        for ( ; sp && !sp->slaves[i] && i < ActiveThreads; i++) {}
+        for ( ; sp && i < ActiveThreads && !sp->slaves[i]; i++) {}
 
         if (i == ActiveThreads)
         {