[cfe-commits] r58266 - /cfe/trunk/Driver/Backend.cpp
Daniel Dunbar
daniel at zuster.org
Mon Oct 27 13:40:42 PDT 2008
Author: ddunbar
Date: Mon Oct 27 15:40:41 2008
New Revision: 58266
URL: http://llvm.org/viewvc/llvm-project?rev=58266&view=rev
Log:
Don't double free module when IRgen fails.
Modified:
cfe/trunk/Driver/Backend.cpp
Modified: cfe/trunk/Driver/Backend.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Driver/Backend.cpp?rev=58266&r1=58265&r2=58266&view=diff
==============================================================================
--- cfe/trunk/Driver/Backend.cpp (original)
+++ cfe/trunk/Driver/Backend.cpp Mon Oct 27 15:40:41 2008
@@ -315,10 +315,13 @@
if (!TheModule || !TheTargetData)
return;
- // Make sure IR generation is happy with the module.
- // FIXME: Release this.
+ // Make sure IR generation is happy with the module. This is
+ // released by the module provider.
Module *M = Gen->ReleaseModule();
if (!M) {
+ // The module has been released by IR gen on failures, do not
+ // double free.
+ ModuleProvider->releaseModule();
TheModule = 0;
return;
}
More information about the cfe-commits
mailing list