[cfe-commits] r92132 - /cfe/trunk/lib/CodeGen/CGTemporaries.cpp

Douglas Gregor dgregor at apple.com
Thu Dec 24 09:48:05 PST 2009


Author: dgregor
Date: Thu Dec 24 11:48:05 2009
New Revision: 92132

URL: http://llvm.org/viewvc/llvm-project?rev=92132&view=rev
Log:
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

Modified:
    cfe/trunk/lib/CodeGen/CGTemporaries.cpp

Modified: cfe/trunk/lib/CodeGen/CGTemporaries.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGTemporaries.cpp?rev=92132&r1=92131&r2=92132&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CGTemporaries.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGTemporaries.cpp Thu Dec 24 11:48:05 2009
@@ -17,6 +17,9 @@
 
 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;





More information about the cfe-commits mailing list