[pr22293] Don't crash during codegen of a recursive destructor.

In ItaniumCXXABI::EmitCXXDestructors we first emit the base destructor
and then try to emit the complete one as an alias.

If in the base ends up calling the complete destructor, the GD for the
complete will be in the list of deferred decl by the time we replace
it with an alias and delete the original GV.

llvm-svn: 226896
This commit is contained in:
Rafael Espindola
2015-01-23 05:26:38 +00:00
parent 5fa925ebf6
commit 6565e92f3f
2 changed files with 12 additions and 1 deletions

View File

@@ -324,7 +324,7 @@ private:
/// referenced. These get code generated when the module is done.
struct DeferredGlobal {
DeferredGlobal(llvm::GlobalValue *GV, GlobalDecl GD) : GV(GV), GD(GD) {}
llvm::AssertingVH<llvm::GlobalValue> GV;
llvm::TrackingVH<llvm::GlobalValue> GV;
GlobalDecl GD;
};
std::vector<DeferredGlobal> DeferredDeclsToEmit;