Fix assert when the pre-hook was fired, but the post hook was skipped

The post hook would have cleared the esp value from the return address map, but there seems to be a case where the post hook isn't called, but the function gets called with the same esp again. This is probably just masking a different error :(
This commit is contained in:
Peace-Maker 2018-01-23 03:16:46 +01:00
parent 1b9fa3743f
commit 94181be280

View File

@ -207,7 +207,10 @@ void* __cdecl CHook::GetReturnAddress(void* pESP)
void __cdecl CHook::SetReturnAddress(void* pRetAddr, void* pESP)
{
ReturnAddressMap::Insert i = m_RetAddr.findForAdd(pESP);
m_RetAddr.add(i, pESP, pRetAddr);
if (i.found())
i->value = pRetAddr;
else
m_RetAddr.add(i, pESP, pRetAddr);
}
void* CHook::CreateBridge()