]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Bug 371491 - handleAddrOverrides() is truncating the segment base address when ASO...
authorJulian Seward <jseward@acm.org>
Thu, 11 May 2017 14:28:10 +0000 (14:28 +0000)
committerJulian Seward <jseward@acm.org>
Thu, 11 May 2017 14:28:10 +0000 (14:28 +0000)
Patch from Michael Daniels (mdaniels@blackberry.com).

git-svn-id: svn://svn.valgrind.org/vex/trunk@3364

VEX/priv/guest_amd64_toIR.c

index b13d5aaa0de33435b4382da51741540db62417fd..ff9ff31bfb89fe080957bb3e16e2510d9484eae4 100644 (file)
@@ -2340,6 +2340,10 @@ static
 IRExpr* handleAddrOverrides ( const VexAbiInfo* vbi, 
                               Prefix pfx, IRExpr* virtual )
 {
+   /* --- address size override --- */
+   if (haveASO(pfx))
+      virtual = unop(Iop_32Uto64, unop(Iop_64to32, virtual));
+
    /* Note that the below are hacks that relies on the assumption
       that %fs or %gs are constant.
       Typically, %fs is always 0x63 on linux (in the main thread, it
@@ -2367,10 +2371,6 @@ IRExpr* handleAddrOverrides ( const VexAbiInfo* vbi,
 
    /* cs, ds, es and ss are simply ignored in 64-bit mode. */
 
-   /* --- address size override --- */
-   if (haveASO(pfx))
-      virtual = unop(Iop_32Uto64, unop(Iop_64to32, virtual));
-
    return virtual;
 }