[cfe-commits] r47675 - /cfe/trunk/AST/CFG.cpp

Ted Kremenek kremenek at apple.com
Wed Feb 27 09:33:02 PST 2008


Author: kremenek
Date: Wed Feb 27 11:33:02 2008
New Revision: 47675

URL: http://llvm.org/viewvc/llvm-project?rev=47675&view=rev
Log:
Fixed edge-case in CFG construction where goto jumps would not always get
properly back-patched.

Modified:
    cfe/trunk/AST/CFG.cpp

Modified: cfe/trunk/AST/CFG.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/AST/CFG.cpp?rev=47675&r1=47674&r2=47675&view=diff

==============================================================================
--- cfe/trunk/AST/CFG.cpp (original)
+++ cfe/trunk/AST/CFG.cpp Wed Feb 27 11:33:02 2008
@@ -142,7 +142,10 @@
   Block = NULL;  // the EXIT block is empty.  Create all other blocks lazily.
   
   // Visit the statements and create the CFG.
-  if (CFGBlock* B = Visit(Statement)) {
+  CFGBlock* B = Visit(Statement);
+  if (!B) B = Succ;
+  
+  if (B) {
     // Finalize the last constructed block.  This usually involves
     // reversing the order of the statements in the block.
     if (Block) FinishBlock(B);





More information about the cfe-commits mailing list