diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2007-11-07 00:46:42 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2007-11-07 00:46:42 +0000 |
commit | 1e7eab4ca34f8a0c076a6783f48e768923a10070 (patch) | |
tree | b264c291fc82d6117939de78f6699e9c1da28e05 | |
parent | 4927be6102784fc69c50234f7e2253283b3e99e4 (diff) |
Fixed a pretty-printer bug whereby a @try statement with no @finally seg faulted.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43798 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | AST/StmtPrinter.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/AST/StmtPrinter.cpp b/AST/StmtPrinter.cpp index ad3091016c..d42a16640f 100644 --- a/AST/StmtPrinter.cpp +++ b/AST/StmtPrinter.cpp @@ -346,11 +346,10 @@ void StmtPrinter::VisitObjcAtTryStmt(ObjcAtTryStmt *Node) { } } - 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"; } } |