From: Douglas Gregor Date: Thu, 24 Dec 2009 17:48:05 +0000 (+0000) Subject: Assert that we aren't trying to push the same C++ temporary onto the live temporary... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=400fd3d80997c401a1bbe69e5d1e94370fcf80cc;p=clang Assert that we aren't trying to push the same C++ temporary onto the live temporary stack twice. A little insurance against PR5867 surprising us again git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92132 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/CGTemporaries.cpp b/lib/CodeGen/CGTemporaries.cpp index 8e214b4676..bfce1b0f74 100644 --- a/lib/CodeGen/CGTemporaries.cpp +++ b/lib/CodeGen/CGTemporaries.cpp @@ -17,6 +17,9 @@ using namespace CodeGen; void CodeGenFunction::PushCXXTemporary(const CXXTemporary *Temporary, llvm::Value *Ptr) { + assert((LiveTemporaries.empty() || + LiveTemporaries.back().ThisPtr != Ptr) && + "Pushed the same temporary twice; AST is likely wrong"); llvm::BasicBlock *DtorBlock = createBasicBlock("temp.dtor"); llvm::Value *CondPtr = 0;