Don't release the Module, as that invalidates the Module* within the
authorMisha Brukman <brukman+llvm@gmail.com>
Fri, 17 Oct 2003 18:31:59 +0000 (18:31 +0000)
committerMisha Brukman <brukman+llvm@gmail.com>
Fri, 17 Oct 2003 18:31:59 +0000 (18:31 +0000)
ModuleProvider, which has bad consequences in lli::callAsMain() which tries to
access that same Module*.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9205 91177308-0d34-0410-b5e6-96231b3b80d8

lib/ExecutionEngine/ExecutionEngine.cpp

index ceeb857020fdbce274694c8215d90e74c09ffdce..d25abfb63f7d9f770d1aa73b8a03869801ae3c92 100644 (file)
@@ -28,7 +28,7 @@ ExecutionEngine::ExecutionEngine(ModuleProvider *P) :
 }
 
 ExecutionEngine::ExecutionEngine(Module *M) : CurMod(*M), MP(0) {
-   assert(M && "Module is null?");
+  assert(M && "Module is null?");
 }
 
 ExecutionEngine::~ExecutionEngine() {
@@ -51,7 +51,7 @@ ExecutionEngine *ExecutionEngine::create(ModuleProvider *MP,
   // If we can't make a JIT, make an interpreter instead.
   try {
     if (EE == 0)
-      EE = Interpreter::create(MP->releaseModule(), TraceMode);
+      EE = Interpreter::create(MP->materializeModule(), TraceMode);
   } catch (...) {
     EE = 0;
   }