summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST
diff options
context:
space:
mode:
authorSteve Naroff <snaroff@apple.com>2009-03-03 19:52:17 +0000
committerSteve Naroff <snaroff@apple.com>2009-03-03 19:52:17 +0000
commit371b8fb4c3083ba22908b0c2f9ae77a3eeb67487 (patch)
tree3c977f6bfe05be733b1135455e1735ee3e333f26 /clang/lib/AST
parent530e03894095ee791c9ed8d3c9d6e4f0bf685d7c (diff)
downloadbcm5719-llvm-371b8fb4c3083ba22908b0c2f9ae77a3eeb67487.tar.gz
bcm5719-llvm-371b8fb4c3083ba22908b0c2f9ae77a3eeb67487.zip
Fix <rdar://problem/6640991> Exception handling executes wrong clause (Daniel, please verify).
Also necessary to fix: <rdar://problem/6632061> [sema] non object types should not be allowed in @catch statements <rdar://problem/6252237> [sema] qualified id should be disallowed in @catch statements llvm-svn: 65964
Diffstat (limited to 'clang/lib/AST')
-rw-r--r--clang/lib/AST/Stmt.cpp4
-rw-r--r--clang/lib/AST/StmtPrinter.cpp6
2 files changed, 5 insertions, 5 deletions
diff --git a/clang/lib/AST/Stmt.cpp b/clang/lib/AST/Stmt.cpp
index e987d84c231..63d3e7f7b4b 100644
--- a/clang/lib/AST/Stmt.cpp
+++ b/clang/lib/AST/Stmt.cpp
@@ -180,10 +180,10 @@ ObjCForCollectionStmt::ObjCForCollectionStmt(Stmt *Elem, Expr *Collect,
ObjCAtCatchStmt::ObjCAtCatchStmt(SourceLocation atCatchLoc,
SourceLocation rparenloc,
- DeclStmt *catchVarStmtDecl, Stmt *atCatchStmt,
+ ParmVarDecl *catchVarDecl, Stmt *atCatchStmt,
Stmt *atCatchList)
: Stmt(ObjCAtCatchStmtClass) {
- SubExprs[SELECTOR] = catchVarStmtDecl;
+ ExceptionDecl = catchVarDecl;
SubExprs[BODY] = atCatchStmt;
SubExprs[NEXT_CATCH] = NULL;
// FIXME: O(N^2) in number of catch blocks.
diff --git a/clang/lib/AST/StmtPrinter.cpp b/clang/lib/AST/StmtPrinter.cpp
index 7e25b465b12..e6ac310b835 100644
--- a/clang/lib/AST/StmtPrinter.cpp
+++ b/clang/lib/AST/StmtPrinter.cpp
@@ -448,9 +448,9 @@ void StmtPrinter::VisitObjCAtTryStmt(ObjCAtTryStmt *Node) {
catchStmt =
static_cast<ObjCAtCatchStmt *>(catchStmt->getNextCatchStmt())) {
Indent() << "@catch(";
- if (catchStmt->getCatchParamStmt()) {
- if (DeclStmt *DS = dyn_cast<DeclStmt>(catchStmt->getCatchParamStmt()))
- PrintRawDeclStmt(DS);
+ if (catchStmt->getCatchParamDecl()) {
+ if (Decl *DS = catchStmt->getCatchParamDecl())
+ PrintRawDecl(DS);
}
OS << ")";
if (CompoundStmt *CS = dyn_cast<CompoundStmt>(catchStmt->getCatchBody()))
OpenPOWER on IntegriCloud