Fix crash in debug mode
authorJoona Kiiski <joona.kiiski@gmail.com>
Mon, 22 Feb 2010 13:42:12 +0000 (15:42 +0200)
committerMarco Costalba <mcostalba@gmail.com>
Tue, 23 Feb 2010 06:23:03 +0000 (07:23 +0100)
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
src/search.cpp

index 974267a635eb01eed4431ae61a84e6cf0c70ce9c..ab9bcca3b781376cb1a5cef4dbb9eccfb1bdba9d 100644 (file)
@@ -2819,7 +2819,9 @@ namespace {
     assert(p.is_ok());
     assert(sstck != NULL);
     assert(ply >= 0 && ply < PLY_MAX);
-    assert(*bestValue >= -VALUE_INFINITE && *bestValue <= *alpha);
+    assert(*bestValue >= -VALUE_INFINITE);
+    assert(   ( pvNode && *bestValue <= *alpha)
+           || (!pvNode && *bestValue <   beta ));
     assert(!pvNode || *alpha < beta);
     assert(beta <= VALUE_INFINITE);
     assert(depth > Depth(0));