]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Ensure VEX control parameters are sane.
authorJulian Seward <jseward@acm.org>
Mon, 6 Dec 2004 14:24:52 +0000 (14:24 +0000)
committerJulian Seward <jseward@acm.org>
Mon, 6 Dec 2004 14:24:52 +0000 (14:24 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3183

coregrind/vg_main.c

index 808e77cb96d23a8414a1d96474f22d33f3542750..b0c286a6724752bf7dcefe9a920a0fea7f112017 100644 (file)
@@ -1858,7 +1858,17 @@ static void process_cmd_line_options( UInt* client_auxv, const char* toolname )
       }
    }
 
-   // Check various option values
+   /* Make VEX control parameters sane */
+
+   if (VG_(clo_vex_control).guest_chase_thresh
+       >= VG_(clo_vex_control).guest_max_insns)
+      VG_(clo_vex_control).guest_chase_thresh
+         = VG_(clo_vex_control).guest_max_insns - 1;
+
+   if (VG_(clo_vex_control).guest_chase_thresh < 0)
+      VG_(clo_vex_control).guest_chase_thresh = 0;
+
+   /* Check various option values */
 
    if (VG_(clo_verbosity) < 0)
       VG_(clo_verbosity) = 0;