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