]> granicus.if.org Git - clang/commitdiff
Assert that we aren't trying to push the same C++ temporary onto the live temporary...
authorDouglas Gregor <dgregor@apple.com>
Thu, 24 Dec 2009 17:48:05 +0000 (17:48 +0000)
committerDouglas Gregor <dgregor@apple.com>
Thu, 24 Dec 2009 17:48:05 +0000 (17:48 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92132 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGTemporaries.cpp

index 8e214b46760e4bf136b17769369f4625151e8f86..bfce1b0f747b515925df21bd820fec3b8810381a 100644 (file)
@@ -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;