Blame SOURCES/valgrind-3.16.1-REX-prefix-JMP.patch

3f23f3
commit e2dec0ff9b1e071779bee2c4e6fc82f8194b1c1d
3f23f3
Author: Mark Wielaard <mark@klomp.org>
3f23f3
Date:   Sun Jul 26 21:17:23 2020 +0200
3f23f3
3f23f3
    Handle REX prefixed JMP instruction.
3f23f3
    
3f23f3
    The NET Core runtime might generate a JMP with a REX prefix.
3f23f3
    For Jv (32bit offset) and Jb (8bit offset) this is valid.
3f23f3
    Prefixes that change operand size are ignored for such JMPs.
3f23f3
    So remove the check for sz == 4 and force sz = 4 for Jv.
3f23f3
    
3f23f3
    https://bugs.kde.org/show_bug.cgi?id=422174
3f23f3
3f23f3
diff --git a/VEX/priv/guest_amd64_toIR.c b/VEX/priv/guest_amd64_toIR.c
3f23f3
index fadf47d41..7888132eb 100644
3f23f3
--- a/VEX/priv/guest_amd64_toIR.c
3f23f3
+++ b/VEX/priv/guest_amd64_toIR.c
3f23f3
@@ -21392,8 +21392,8 @@ Long dis_ESC_NONE (
3f23f3
 
3f23f3
    case 0xE9: /* Jv (jump, 16/32 offset) */
3f23f3
       if (haveF3(pfx)) goto decode_failure;
3f23f3
-      if (sz != 4) 
3f23f3
-         goto decode_failure; /* JRS added 2004 July 11 */
3f23f3
+      sz = 4; /* Prefixes that change operand size are ignored for this
3f23f3
+                 instruction. Operand size is forced to 32bit. */
3f23f3
       if (haveF2(pfx)) DIP("bnd ; "); /* MPX bnd prefix. */
3f23f3
       d64 = (guest_RIP_bbstart+delta+sz) + getSDisp(sz,delta); 
3f23f3
       delta += sz;
3f23f3
@@ -21404,8 +21404,7 @@ Long dis_ESC_NONE (
3f23f3
 
3f23f3
    case 0xEB: /* Jb (jump, byte offset) */
3f23f3
       if (haveF3(pfx)) goto decode_failure;
3f23f3
-      if (sz != 4) 
3f23f3
-         goto decode_failure; /* JRS added 2004 July 11 */
3f23f3
+      /* Prefixes that change operand size are ignored for this instruction. */
3f23f3
       if (haveF2(pfx)) DIP("bnd ; "); /* MPX bnd prefix. */
3f23f3
       d64 = (guest_RIP_bbstart+delta+1) + getSDisp8(delta); 
3f23f3
       delta++;