Cosmos/source2/Compiler/Cosmos.Compiler.DebugStub/Utilities.xs
mterwoord_cp c603c1cb0c
2014-07-08 13:46:00 +00:00

20 lines
No EOL
416 B
Text

namespace DebugStub
// Uses EAX: expected difference.
// Modifies: EBX
function CheckStack {
// after a call, the stack gets pushed to, so add 4 to the expected difference
eax + 4
EBX = EBP
EBX + EAX
if EBX != ESP {
// stack corruption.
EAX = ESP[0]
.CallerEIP = EAX
SendStackCorruptionOccurred()
halt:
goto halt
}
}