Discussion:
vex: r3364 - /trunk/priv/guest_amd64_toIR.c
Add Reply
s***@valgrind.org
2017-05-11 14:28:10 UTC
Reply
Permalink
Raw Message
Author: sewardj
Date: Thu May 11 15:28:10 2017
New Revision: 3364

Log:
Bug 371491 - handleAddrOverrides() is truncating the segment base address when ASO prefix is used.
Patch from Michael Daniels (***@blackberry.com).


Modified:
trunk/priv/guest_amd64_toIR.c

Modified: trunk/priv/guest_amd64_toIR.c
==============================================================================
--- trunk/priv/guest_amd64_toIR.c (original)
+++ trunk/priv/guest_amd64_toIR.c Thu May 11 15:28:10 2017
@@ -2340,6 +2340,10 @@
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 @@

/* 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;
}

Loading...