[LLVMdev] Cannot remove module from empty JIT

Verena Beckham verena at codeplay.com
Tue Jul 24 04:42:02 PDT 2012


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



More information about the llvm-dev mailing list