]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Handle both %gs and %fs prefixes on amd64 a bit more "properly".
authorJulian Seward <jseward@acm.org>
Thu, 22 Jan 2009 20:40:22 +0000 (20:40 +0000)
committerJulian Seward <jseward@acm.org>
Thu, 22 Jan 2009 20:40:22 +0000 (20:40 +0000)
git-svn-id: svn://svn.valgrind.org/vex/trunk@1881

VEX/priv/guest-amd64/toIR.c

index 9a870063e2c3d80446a95cfe4d4e0fe46a8fffa6..b8f34fdfd476cf069500a3ac8659ea924b280333 100644 (file)
@@ -8813,8 +8813,14 @@ DisResult disInstr_AMD64_WRK (
    if (n > 1) 
       goto decode_failure; /* multiple seg overrides == illegal */
 
-   if (pfx & PFX_GS)
-      goto decode_failure; /* legal, but unsupported right now */
+   /* We have a %fs prefix.  Reject it if there's no evidence in 'vbi'
+      that we should accept it. */
+   if ((pfx & PFX_FS) && !vbi->guest_amd64_assume_fs_is_zero)
+      goto decode_failure;
+
+   /* Ditto for %gs prefixes. */
+   if ((pfx & PFX_GS) && !vbi->guest_amd64_assume_gs_is_0x60)
+      goto decode_failure;
 
    /* Set up sz. */
    sz = 4;