]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
More icc-related cleanups.
authorJulian Seward <jseward@acm.org>
Sat, 26 Feb 2005 02:00:50 +0000 (02:00 +0000)
committerJulian Seward <jseward@acm.org>
Sat, 26 Feb 2005 02:00:50 +0000 (02:00 +0000)
git-svn-id: svn://svn.valgrind.org/vex/trunk@978

VEX/priv/guest-x86/toIR.c

index 2a29034a8bb9dd345d7121c4dec920154c5e7d27..31d78a3591033ae3f51382f9799357a0f16d1e71 100644 (file)
    bit be set by PUSHF.
 
    This module uses global variables and so is not MT-safe (if that
-   should ever become relevant).  */
+   should ever become relevant).
+
+   The delta values are 32-bit ints, not 64-bit ints.  That means
+   this module may not work right if run on a 64-bit host.  That should
+   be fixed properly, really -- if anyone ever wants to use Vex to
+   translate x86 code for execution on a 64-bit host.
+*/
 
 /* Translates x86 code to IR. */
 
@@ -320,7 +326,13 @@ IRBB* bbToIR_X86 ( UChar*           x86code,
       }
 
       delta += size;
-      vge->len[vge->n_used-1] += size;
+      /* If vex_control.guest_max_insns is required to be < 500 and
+        each insn is at max 15 bytes long, this limit of 10000 then
+        seems reasonable since the max possible extent length will be
+        500 * 15 == 7500. */
+      vassert(vge->len[vge->n_used-1] < 10000);
+      vge->len[vge->n_used-1] 
+         = toUShort(toUInt( vge->len[vge->n_used-1] + size ));
       n_instrs++;
       DIP("\n");
 
@@ -347,7 +359,7 @@ IRBB* bbToIR_X86 ( UChar*           x86code,
             vassert(irbb->next == NULL);
             /* figure out a new delta to continue at. */
             vassert(chase_into_ok(guest_next));
-            delta = (UInt)(guest_next - guest_eip_start);
+            delta = toUInt(guest_next - guest_eip_start);
             /* we now have to start a new extent slot. */
            vge->n_used++;
            vassert(vge->n_used <= 3);