зеркало из https://github.com/microsoft/clang.git
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:
Родитель
7e9f1f7de8
Коммит
d611bac92c
|
@ -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;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче