diff options
author | Jeffrey Yasskin <jyasskin@google.com> | 2009-12-22 23:18:18 +0000 |
---|---|---|
committer | Jeffrey Yasskin <jyasskin@google.com> | 2009-12-22 23:18:18 +0000 |
commit | 92fdf4537bd298673552d47adac2ff7bceab9dc9 (patch) | |
tree | cc1b23da37c2a4bbc99761558490360044203fe1 /lib/ExecutionEngine/JIT/JIT.cpp | |
parent | 167bea71a4bd19329a218f5e1bd8facfd90a0cf9 (diff) |
Fix a crash in JIT::recompileAndRelinkFunction(). It doesn't pass the MCI
argument to runJITOnFunction(), which caused a null pointer dereference at
every call.
Patch by Gianluca Guida!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91939 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ExecutionEngine/JIT/JIT.cpp')
-rw-r--r-- | lib/ExecutionEngine/JIT/JIT.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/ExecutionEngine/JIT/JIT.cpp b/lib/ExecutionEngine/JIT/JIT.cpp index 9b5a176ff5..ebc2567743 100644 --- a/lib/ExecutionEngine/JIT/JIT.cpp +++ b/lib/ExecutionEngine/JIT/JIT.cpp @@ -611,11 +611,13 @@ void JIT::runJITOnFunction(Function *F, MachineCodeInfo *MCI) { } }; MCIListener MCIL(MCI); - RegisterJITEventListener(&MCIL); + if (MCI) + RegisterJITEventListener(&MCIL); runJITOnFunctionUnlocked(F, locked); - UnregisterJITEventListener(&MCIL); + if (MCI) + UnregisterJITEventListener(&MCIL); } void JIT::runJITOnFunctionUnlocked(Function *F, const MutexGuard &locked) { |