mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-20 00:56:39 +08:00
Fix a possible crash in thread_is_available()
When we have more then 2 threads then we do an array access with index 'Threads[slave].activeSplitPoints - 1' This should be >= 0 because we tested the variable just few statements before, but because is a shared variable it could be that the 'slave' thread set the value to zero just after we test it, so that when we use the decremented variable for array access we crash. Bug spotted by Bruno Causse. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
@@ -64,7 +64,7 @@ struct SplitPoint {
|
||||
|
||||
struct Thread {
|
||||
SplitPoint *splitPoint;
|
||||
int activeSplitPoints;
|
||||
volatile int activeSplitPoints;
|
||||
uint64_t nodes;
|
||||
uint64_t betaCutOffs[2];
|
||||
bool failHighPly1;
|
||||
|
||||
Reference in New Issue
Block a user