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,6 +231,7 @@ namespace SourceHook
|
|||||||
if (subtractFromEsp < 0)
|
if (subtractFromEsp < 0)
|
||||||
subtractFromEsp = 16 - ((-subtractFromEsp) % 16);
|
subtractFromEsp = 16 - ((-subtractFromEsp) % 16);
|
||||||
|
|
||||||
|
if (subtractFromEsp != 0)
|
||||||
IA32_Sub_Rm_ImmAuto(&m_HookFunc, REG_ESP, subtractFromEsp, MOD_REG);
|
IA32_Sub_Rm_ImmAuto(&m_HookFunc, REG_ESP, subtractFromEsp, MOD_REG);
|
||||||
|
|
||||||
return subtractFromEsp;
|
return subtractFromEsp;
|
||||||
@ -238,6 +239,7 @@ namespace SourceHook
|
|||||||
|
|
||||||
void GenContext::AlignStackAfterCall(jit_int32_t numofbytes)
|
void GenContext::AlignStackAfterCall(jit_int32_t numofbytes)
|
||||||
{
|
{
|
||||||
|
if (numofbytes != 0)
|
||||||
IA32_Add_Rm_ImmAuto(&m_HookFunc, REG_ESP, numofbytes, MOD_REG);
|
IA32_Add_Rm_ImmAuto(&m_HookFunc, REG_ESP, numofbytes, MOD_REG);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user