Fix potential overflow
authorJoona Kiiski <joona.kiiski@gmail.com>
Tue, 23 Apr 2013 06:26:36 +0000 (07:26 +0100)
committerJoona Kiiski <joona.kiiski@gmail.com>
Tue, 23 Apr 2013 06:26:36 +0000 (07:26 +0100)
src/search.cpp

index 80ac9b20b26f351b196e8f55cc09c28d9b05c199..267f5f8f4c64c87fbacc15f9184a16242dbcd394 100644 (file)
@@ -643,10 +643,10 @@ namespace {
         && !ss->skipNullMove
         &&  depth < 4 * ONE_PLY
         && !inCheck
-        &&  eval - FutilityMargins[depth][(ss-1)->futMc] >= beta
+        &&  eval - futility_margin(depth, (ss-1)->futMc) >= beta
         &&  abs(beta) < VALUE_MATE_IN_MAX_PLY
         &&  pos.non_pawn_material(pos.side_to_move()))
-        return eval - FutilityMargins[depth][(ss-1)->futMc];
+        return eval - futility_margin(depth, (ss-1)->futMc);
 
     // Step 8. Null move search with verification search (is omitted in PV nodes)
     if (   !PvNode