Fix DHooks jit code stack memory alignment (#1849)

This commit is contained in:
Maxim Telezhenko
2023-08-30 22:08:45 +02:00
committed by Your Name
parent 18b2ffa786
commit 08841227a4
+3 -3
View File
@@ -355,13 +355,13 @@ void CHook::Write_CallHandler(sp::MacroAssembler& masm, HookType_t type)
Write_SaveRegisters(masm, type);
// Align the stack to 16 bytes.
masm.subl(esp, 8);
masm.subl(esp, 4);
// Call the global hook handler
masm.push(type);
masm.push(intptr_t(this));
masm.call(ExternalAddress((void *&)HookHandler));
masm.addl(esp, 16);
masm.addl(esp, 12);
}
void CHook::Write_SaveRegisters(sp::MacroAssembler& masm, HookType_t type)
@@ -501,4 +501,4 @@ void CHook::Write_RestoreRegisters(sp::MacroAssembler& masm, HookType_t type)
default: puts("Unsupported register.");
}
}
}
}