mirror of
https://github.com/alliedmodders/metamod-source.git
synced 2025-02-27 20:54:14 +01:00
Only emit alignment code if it is necessary (no sub esp, 0)
--HG-- branch : hookman_autogen extra : convert_revision : svn%3Ac2935e3e-5518-0410-8daf-afa5dab7d4e3/branches/hookman_autogen%40578
This commit is contained in:
parent
d3c3737355
commit
f307e85458
@ -231,14 +231,16 @@ namespace SourceHook
|
||||
if (subtractFromEsp < 0)
|
||||
subtractFromEsp = 16 - ((-subtractFromEsp) % 16);
|
||||
|
||||
IA32_Sub_Rm_ImmAuto(&m_HookFunc, REG_ESP, subtractFromEsp, MOD_REG);
|
||||
if (subtractFromEsp != 0)
|
||||
IA32_Sub_Rm_ImmAuto(&m_HookFunc, REG_ESP, subtractFromEsp, MOD_REG);
|
||||
|
||||
return subtractFromEsp;
|
||||
}
|
||||
|
||||
void GenContext::AlignStackAfterCall(jit_int32_t numofbytes)
|
||||
{
|
||||
IA32_Add_Rm_ImmAuto(&m_HookFunc, REG_ESP, numofbytes, MOD_REG);
|
||||
if (numofbytes != 0)
|
||||
IA32_Add_Rm_ImmAuto(&m_HookFunc, REG_ESP, numofbytes, MOD_REG);
|
||||
}
|
||||
|
||||
void GenContext::CheckAlignmentBeforeCall()
|
||||
|
Loading…
x
Reference in New Issue
Block a user