Fix new - free mismatch
This commit is contained in:
parent
764b325a1e
commit
63c6addc30
@ -240,8 +240,6 @@ class DHooksConfig(object):
|
|||||||
os.path.join(self.sm_root, 'sourcepawn', 'vm', 'x86'),
|
os.path.join(self.sm_root, 'sourcepawn', 'vm', 'x86'),
|
||||||
os.path.join(self.sm_root, 'public', 'amtl', 'include'),
|
os.path.join(self.sm_root, 'public', 'amtl', 'include'),
|
||||||
os.path.join(self.sm_root, 'public', 'amtl', 'amtl'),
|
os.path.join(self.sm_root, 'public', 'amtl', 'amtl'),
|
||||||
os.path.join(builder.currentSourcePath, 'DynamicHooks', 'thirdparty'),
|
|
||||||
os.path.join(builder.currentSourcePath, 'DynamicHooks', 'thirdparty', 'AsmJit'),
|
|
||||||
os.path.join(builder.currentSourcePath, 'DynamicHooks'),
|
os.path.join(builder.currentSourcePath, 'DynamicHooks'),
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -274,32 +272,6 @@ program.sources += [
|
|||||||
os.path.join('DynamicHooks', 'conventions', 'x86MsThiscall.cpp'),
|
os.path.join('DynamicHooks', 'conventions', 'x86MsThiscall.cpp'),
|
||||||
]
|
]
|
||||||
|
|
||||||
# ASMJit
|
|
||||||
program.sources += [
|
|
||||||
os.path.join('DynamicHooks', 'thirdparty', 'AsmJit', 'base', 'assembler.cpp'),
|
|
||||||
os.path.join('DynamicHooks', 'thirdparty', 'AsmJit', 'base', 'compiler.cpp'),
|
|
||||||
os.path.join('DynamicHooks', 'thirdparty', 'AsmJit', 'base', 'compilercontext.cpp'),
|
|
||||||
os.path.join('DynamicHooks', 'thirdparty', 'AsmJit', 'base', 'constpool.cpp'),
|
|
||||||
os.path.join('DynamicHooks', 'thirdparty', 'AsmJit', 'base', 'containers.cpp'),
|
|
||||||
os.path.join('DynamicHooks', 'thirdparty', 'AsmJit', 'base', 'cpuinfo.cpp'),
|
|
||||||
os.path.join('DynamicHooks', 'thirdparty', 'AsmJit', 'base', 'globals.cpp'),
|
|
||||||
os.path.join('DynamicHooks', 'thirdparty', 'AsmJit', 'base', 'hlstream.cpp'),
|
|
||||||
os.path.join('DynamicHooks', 'thirdparty', 'AsmJit', 'base', 'logger.cpp'),
|
|
||||||
os.path.join('DynamicHooks', 'thirdparty', 'AsmJit', 'base', 'operand.cpp'),
|
|
||||||
os.path.join('DynamicHooks', 'thirdparty', 'AsmJit', 'base', 'podvector.cpp'),
|
|
||||||
os.path.join('DynamicHooks', 'thirdparty', 'AsmJit', 'base', 'runtime.cpp'),
|
|
||||||
os.path.join('DynamicHooks', 'thirdparty', 'AsmJit', 'base', 'utils.cpp'),
|
|
||||||
os.path.join('DynamicHooks', 'thirdparty', 'AsmJit', 'base', 'vmem.cpp'),
|
|
||||||
os.path.join('DynamicHooks', 'thirdparty', 'AsmJit', 'base', 'zone.cpp'),
|
|
||||||
os.path.join('DynamicHooks', 'thirdparty', 'AsmJit', 'x86', 'x86assembler.cpp'),
|
|
||||||
os.path.join('DynamicHooks', 'thirdparty', 'AsmJit', 'x86', 'x86compiler.cpp'),
|
|
||||||
os.path.join('DynamicHooks', 'thirdparty', 'AsmJit', 'x86', 'x86compilercontext.cpp'),
|
|
||||||
os.path.join('DynamicHooks', 'thirdparty', 'AsmJit', 'x86', 'x86compilerfunc.cpp'),
|
|
||||||
os.path.join('DynamicHooks', 'thirdparty', 'AsmJit', 'x86', 'x86inst.cpp'),
|
|
||||||
os.path.join('DynamicHooks', 'thirdparty', 'AsmJit', 'x86', 'x86operand.cpp'),
|
|
||||||
os.path.join('DynamicHooks', 'thirdparty', 'AsmJit', 'x86', 'x86operand_regs.cpp'),
|
|
||||||
]
|
|
||||||
|
|
||||||
program.sources += [os.path.join(DHooks.sm_root, 'public', 'smsdk_ext.cpp')]
|
program.sources += [os.path.join(DHooks.sm_root, 'public', 'smsdk_ext.cpp')]
|
||||||
|
|
||||||
if os.path.isfile(os.path.join(DHooks.sm_root, 'sourcepawn', 'vm', 'x86', 'assembler-x86.cpp')):
|
if os.path.isfile(os.path.join(DHooks.sm_root, 'sourcepawn', 'vm', 'x86', 'assembler-x86.cpp')):
|
||||||
|
@ -88,7 +88,7 @@ CHook::~CHook()
|
|||||||
copy_bytes((unsigned char *) m_pTrampoline, (unsigned char *) m_pFunc, JMP_SIZE);
|
copy_bytes((unsigned char *) m_pTrampoline, (unsigned char *) m_pFunc, JMP_SIZE);
|
||||||
|
|
||||||
// Free the trampoline array
|
// Free the trampoline array
|
||||||
free(m_pTrampoline);
|
delete [] m_pTrampoline;
|
||||||
|
|
||||||
// Free the asm bridge and new return address
|
// Free the asm bridge and new return address
|
||||||
smutils->GetScriptingEngine()->FreePageMemory(m_pBridge);
|
smutils->GetScriptingEngine()->FreePageMemory(m_pBridge);
|
||||||
@ -165,7 +165,7 @@ void* CHook::CreateBridge()
|
|||||||
|
|
||||||
// Call the pre-hook handler and jump to label_supercede if true was returned
|
// Call the pre-hook handler and jump to label_supercede if true was returned
|
||||||
Write_CallHandler(masm, HOOKTYPE_PRE);
|
Write_CallHandler(masm, HOOKTYPE_PRE);
|
||||||
masm.cmpl(r8_al, int8_t(1));
|
masm.cmpb(r8_al, true);
|
||||||
|
|
||||||
// Restore the previously saved registers, so any changes will be applied
|
// Restore the previously saved registers, so any changes will be applied
|
||||||
Write_RestoreRegisters(masm);
|
Write_RestoreRegisters(masm);
|
||||||
|
Loading…
Reference in New Issue
Block a user