Fixed a pretty-printer bug whereby a @try statement with no @finally seg faulted.

llvm-svn: 43798
This commit is contained in:
Fariborz Jahanian 2007-11-07 00:46:42 +00:00
parent ad1bc400d7
commit defbf9a86c

View File

@ -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";
}
}