]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Observe caller-supplied limit on # of insns allowed in a bb.
authorJulian Seward <jseward@acm.org>
Sun, 25 Jul 2004 17:25:06 +0000 (17:25 +0000)
committerJulian Seward <jseward@acm.org>
Sun, 25 Jul 2004 17:25:06 +0000 (17:25 +0000)
git-svn-id: svn://svn.valgrind.org/vex/trunk@120

VEX/priv/guest-x86/x86toIR.c

index 2e87a03a34afdc77de6ec1d5c150d0f90077c069..fe9dd5e41c4d000adb06acadb090515e4d3c3704 100644 (file)
@@ -7983,6 +7983,7 @@ IRBB* bbToIR_X86Instr ( UChar* x86code,
    last_stmt         = NULL;
 
    vassert((eip >> 32) == 0);
+   vassert(vex_guest_insns_per_bb >= 1);
 
    DIP("Original x86 code to IR:\n\n");
 
@@ -7993,6 +7994,11 @@ IRBB* bbToIR_X86Instr ( UChar* x86code,
    n_instrs = 0;
    while (True) {
       if (isEnd) break;
+      if (n_instrs == vex_guest_insns_per_bb) {
+         vassert(irbb->next == NULL);
+         irbb->next = mkU32(((Addr32)eip)+delta);
+         break;
+      }
       vassert(n_instrs < vex_guest_insns_per_bb);
       delta = disInstr ( delta, &isEnd );
       n_instrs++;