mirror of
https://github.com/Cisco-Talos/clamav.git
synced 2025-11-01 16:40:54 +00:00
Fix valgrind warning.
This commit is contained in:
parent
9aa1d72591
commit
e2752b2cc8
1 changed files with 7 additions and 3 deletions
|
|
@ -96,6 +96,7 @@ using namespace llvm;
|
|||
typedef DenseMap<const struct cli_bc_func*, void*> FunctionMapTy;
|
||||
struct cli_bcengine {
|
||||
ExecutionEngine *EE;
|
||||
JITEventListener *Listener;
|
||||
LLVMContext Context;
|
||||
FunctionMapTy compiledFunctions;
|
||||
union {
|
||||
|
|
@ -1378,8 +1379,8 @@ int cli_bytecode_prepare_jit(struct cli_all_bc *bcs)
|
|||
errs() << MODULE << "JIT not registered?\n";
|
||||
return CL_EBYTECODE;
|
||||
}
|
||||
|
||||
EE->RegisterJITEventListener(new NotifyListener());
|
||||
bcs->engine->Listener = new NotifyListener();
|
||||
EE->RegisterJITEventListener(bcs->engine->Listener);
|
||||
// EE->RegisterJITEventListener(createOProfileJITEventListener());
|
||||
// Due to LLVM PR4816 only X86 supports non-lazy compilation, disable
|
||||
// for now.
|
||||
|
|
@ -1585,8 +1586,11 @@ int cli_bytecode_done_jit(struct cli_all_bc *bcs)
|
|||
{
|
||||
LLVMApiScopedLock scopedLock;
|
||||
if (bcs->engine) {
|
||||
if (bcs->engine->EE)
|
||||
if (bcs->engine->EE) {
|
||||
bcs->engine->EE->UnregisterJITEventListener(bcs->engine->Listener);
|
||||
delete bcs->engine->EE;
|
||||
}
|
||||
delete bcs->engine->Listener;
|
||||
delete bcs->engine;
|
||||
bcs->engine = 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue