]> git.sesse.net Git - stockfish/commitdiff
Fix a crash on multi-pv
authorMarco Costalba <mcostalba@gmail.com>
Sat, 1 Jan 2011 22:10:37 +0000 (23:10 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Sat, 1 Jan 2011 22:10:37 +0000 (23:10 +0100)
Bug reported by Tobias Haspel and fixed by Joona.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
src/search.cpp

index 355eed1b24ca79327194aaf8f90ab4f549e57cec..d93fbdf79635d3b14a854fa979e87babb802df7c 100644 (file)
@@ -903,7 +903,7 @@ namespace {
 
     // Write PV lines to transposition table, in case the relevant entries
     // have been overwritten during the search.
 
     // Write PV lines to transposition table, in case the relevant entries
     // have been overwritten during the search.
-    for (int i = 0; i < MultiPV; i++)
+    for (int i = 0; i < Min(MultiPV, (int)rml.size()); i++)
         rml[i].insert_pv_in_tt(pos);
 
     return alpha;
         rml[i].insert_pv_in_tt(pos);
 
     return alpha;