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