diff --git a/src/codegen.cpp b/src/codegen.cpp index 70daecb6fb61e..a4ffb0a760e5e 100644 --- a/src/codegen.cpp +++ b/src/codegen.cpp @@ -4620,7 +4620,7 @@ static Function *emit_tojlinvoke(jl_code_instance_t *codeinst, Module *M, jl_cod ctx.builder.SetInsertPoint(b0); Function *theFunc; Value *theFarg; - if (codeinst->invoke != NULL) { + if (params.cache && codeinst->invoke != NULL) { StringRef theFptrName = jl_ExecutionEngine->getFunctionAtAddress((uintptr_t)codeinst->invoke, codeinst); theFunc = cast( M->getOrInsertFunction(theFptrName, jlinvoke_func->_type(jl_LLVMContext)).getCallee());