diff --git a/lib/ExecutionEngine/JIT/JITEmitter.cpp b/lib/ExecutionEngine/JIT/JITEmitter.cpp index dd81f321c12..a74f53d2ab9 100644 --- a/lib/ExecutionEngine/JIT/JITEmitter.cpp +++ b/lib/ExecutionEngine/JIT/JITEmitter.cpp @@ -611,7 +611,7 @@ void *JITEmitter::getPointerToGlobal(GlobalValue *V, void *Reference, // If we have already compiled the function, return a pointer to its body. Function *F = cast(V); void *ResultPtr; - if (!DoesntNeedStub) + if (!DoesntNeedStub && !TheJIT->isLazyCompilationDisabled()) // Return the function stub if it's already created. ResultPtr = Resolver.getFunctionStubIfAvailable(F); else