[llvm-commits] [LLVMdev] Cannot remove module from empty JIT
Verena Beckham
verena at codeplay.com
Wed Jul 25 02:10:07 PDT 2012
Hi,
Great, I made a patch (though trivial). Would you apply it for me? I
don't have commit rights.
Thanks very much.
Verena
On 24/07/2012 18:01, Jim Grosbach wrote:
> Sure, seems reasonable.
>
> -Jim
>
> On Jul 24, 2012, at 4:42 AM, Verena Beckham <verena at codeplay.com> wrote:
>
>> Hi,
>>
>> You cannot call removeModule on a JIT with no modules: jitstate will be
>> 0 and therefore we have a null-pointer exception.
>> The function returns a boolean for success/failure, however, so you
>> would expect to be able to call it and get false back.
>>
>> Should we be checking for jitstate != 0 before accessing the variable?
>>
>> - if (jitstate->getModule() == M) {
>> + if (jitstate && jitstate->getModule() == M) {
>>
>>
>> Verena
>> _______________________________________________
>> LLVM Developers mailing list
>> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
-------------- next part --------------
Index: lib/ExecutionEngine/JIT/JIT.cpp
===================================================================
--- lib/ExecutionEngine/JIT/JIT.cpp (revision 160710)
+++ lib/ExecutionEngine/JIT/JIT.cpp (working copy)
@@ -361,7 +361,7 @@
MutexGuard locked(lock);
- if (jitstate->getModule() == M) {
+ if (jitstate && jitstate->getModule() == M) {
delete jitstate;
jitstate = 0;
}
More information about the llvm-commits
mailing list