Don't double free module when IRgen fails.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58266 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Daniel Dunbar 2008-10-27 20:40:41 +00:00
Родитель 7e9f1f7de8
Коммит d611bac92c
1 изменённых файлов: 5 добавлений и 2 удалений

Просмотреть файл

@ -315,10 +315,13 @@ void BackendConsumer::EmitAssembly() {
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;
}