- // Pick the next available split point from the split point stack
- SplitPoint* sp = &masterThread.splitPoints[masterThread.activeSplitPoints];
-
- // Initialize the split point
- sp->parent = masterThread.splitPoint;
- sp->master = master;
- sp->is_betaCutoff = false;
- sp->depth = depth;
- sp->threatMove = threatMove;
- sp->alpha = alpha;
- sp->beta = beta;
- sp->nodeType = nodeType;
- sp->bestValue = bestValue;
- sp->mp = mp;
- sp->moveCount = moveCount;
- sp->pos = &pos;
- sp->nodes = 0;
- sp->ss = ss;
-
- for (i = 0; i < activeThreads; i++)
- sp->is_slave[i] = false;
-
- // If we are here it means we are not available
- assert(masterThread.is_searching);
-
- int workersCnt = 1; // At least the master is included
+ // Make a local copy to be sure doesn't become zero under our feet while
+ // testing next condition and so leading to an out of bound access.
+ int size = splitPointsSize;