Skip to content

Commit 155eb8b

Browse files
committed
[x86] Fixes #6628: "sysret should be considered a terminator #6628" by lifting XED_ICLASS_SYSRET* instructions as returns to RCX
1 parent dc2911d commit 155eb8b

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

arch/x86/il.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3552,11 +3552,19 @@ bool GetLowLevelILForInstruction(Architecture* arch, const uint64_t addr, LowLev
35523552
break;
35533553

35543554
case XED_ICLASS_SYSEXIT:
3555-
case XED_ICLASS_SYSRET:
35563555
case XED_ICLASS_HLT:
35573556
il.AddInstruction(il.Trap(TRAP_GPF));
35583557
return false;
35593558

3559+
case XED_ICLASS_SYSRET:
3560+
il.AddInstruction(il.Return(il.Register(addrSize, XED_REG_ECX)));
3561+
break;
3562+
3563+
case XED_ICLASS_SYSRET64:
3564+
case XED_ICLASS_SYSRET_AMD:
3565+
il.AddInstruction(il.Return(il.Register(addrSize, XED_REG_RCX)));
3566+
break;
3567+
35603568
case XED_ICLASS_FLD:
35613569
il.AddInstruction(
35623570
il.RegisterStackPush(10,

0 commit comments

Comments
 (0)