Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit 882c13b

Browse files
authored
[release/3.1] Fix lazy machine state unwinding for MSVC epilogues on x86 (#28150)
1 parent 867aa5e commit 882c13b

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/vm/i386/gmsx86.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -828,6 +828,8 @@ void LazyMachState::unwindLazyState(LazyMachState* baseState,
828828
case 0x89: // MOV r/m, reg
829829
if (ip[1] == 0xEC) // MOV ESP, EBP
830830
goto mov_esp_ebp;
831+
if (ip[1] == 0xDC) // MOV ESP, EBX
832+
goto mov_esp_ebx;
831833
// FALL THROUGH
832834

833835
case 0x18: // SBB r/m8, r8
@@ -933,6 +935,13 @@ void LazyMachState::unwindLazyState(LazyMachState* baseState,
933935
break;
934936
}
935937

938+
if (ip[1] == 0xE3) { // MOV ESP, EBX
939+
mov_esp_ebx:
940+
ESP = PTR_TADDR(lazyState->_ebx);
941+
ip += 2;
942+
break;
943+
}
944+
936945
if ((ip[1] & 0xc7) == 0x4 && ip[2] == 0x24) // move reg, [esp]
937946
{
938947
if ( ip[1] == 0x1C ) { // MOV EBX, [ESP]

0 commit comments

Comments
 (0)