Fix new - free mismatch

This commit is contained in:
Peace-Maker 2016-12-12 22:47:35 -07:00
parent 764b325a1e
commit 63c6addc30
2 changed files with 2 additions and 30 deletions

View File

@ -240,8 +240,6 @@ class DHooksConfig(object):
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', 'amtl'),
os.path.join(builder.currentSourcePath, 'DynamicHooks', 'thirdparty'),
os.path.join(builder.currentSourcePath, 'DynamicHooks', 'thirdparty', 'AsmJit'),
os.path.join(builder.currentSourcePath, 'DynamicHooks'),
]
@ -274,32 +272,6 @@ program.sources += [
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')]
if os.path.isfile(os.path.join(DHooks.sm_root, 'sourcepawn', 'vm', 'x86', 'assembler-x86.cpp')):

View File

@ -88,7 +88,7 @@ CHook::~CHook()
copy_bytes((unsigned char *) m_pTrampoline, (unsigned char *) m_pFunc, JMP_SIZE);
// Free the trampoline array
free(m_pTrampoline);
delete [] m_pTrampoline;
// Free the asm bridge and new return address
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
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
Write_RestoreRegisters(masm);