[cfe-commits] r43798 - /cfe/trunk/AST/StmtPrinter.cpp

Fariborz Jahanian fjahanian at apple.com
Tue Nov 6 16:46:42 PST 2007


Author: fjahanian
Date: Tue Nov  6 18:46:42 2007
New Revision: 43798

URL: http://llvm.org/viewvc/llvm-project?rev=43798&view=rev
Log:
Fixed a pretty-printer bug whereby a @try statement with no @finally seg faulted.

Modified:
    cfe/trunk/AST/StmtPrinter.cpp

Modified: cfe/trunk/AST/StmtPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/AST/StmtPrinter.cpp?rev=43798&r1=43797&r2=43798&view=diff

==============================================================================
--- cfe/trunk/AST/StmtPrinter.cpp (original)
+++ cfe/trunk/AST/StmtPrinter.cpp Tue Nov  6 18:46:42 2007
@@ -346,11 +346,10 @@
       } 
   }
   
-  Indent() << "@finally";
-  if (CompoundStmt *FS = dyn_cast<CompoundStmt>(
-        static_cast<ObjcAtFinallyStmt *>(
-          Node->getFinallyStmt())->getFinallyBody())) {
-    PrintRawCompoundStmt(FS);
+  if (ObjcAtFinallyStmt *FS =static_cast<ObjcAtFinallyStmt *>(
+          Node->getFinallyStmt())) {
+    Indent() << "@finally";
+    PrintRawCompoundStmt(dyn_cast<CompoundStmt>(FS->getFinallyBody()));
     OS << "\n";
   }  
 }





More information about the cfe-commits mailing list