Fixed an array overflow bug.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43826 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/AST/Stmt.cpp b/AST/Stmt.cpp
index 28681c6..ccd27af 100644
--- a/AST/Stmt.cpp
+++ b/AST/Stmt.cpp
@@ -206,7 +206,7 @@
// ObjcAtTryStmt
Stmt::child_iterator ObjcAtTryStmt::child_begin() { return &SubStmts[0]; }
Stmt::child_iterator ObjcAtTryStmt::child_end() {
- return &SubStmts[0]+END_TRY;
+ return &SubStmts[0]+END_EXPR;
}
// ObjcAtThrowStmt
diff --git a/include/clang/AST/Stmt.h b/include/clang/AST/Stmt.h
index 10236e1..7f927b1 100644
--- a/include/clang/AST/Stmt.h
+++ b/include/clang/AST/Stmt.h
@@ -734,7 +734,6 @@
: Stmt(ObjcAtCatchStmtClass) {
SubExprs[SELECTOR] = catchVarStmtDecl;
SubExprs[BODY] = atCatchStmt;
- SubExprs[END_EXPR] = NULL;
if (!atCatchList)
NextAtCatchStmt = NULL;
else {
@@ -803,8 +802,8 @@
/// @try ... @catch ... @finally statement.
class ObjcAtTryStmt : public Stmt {
private:
- enum { TRY, CATCH, FINALLY, END_TRY };
- Stmt* SubStmts[END_TRY];
+ enum { TRY, CATCH, FINALLY, END_EXPR };
+ Stmt* SubStmts[END_EXPR];
SourceLocation AtTryLoc;
@@ -816,7 +815,6 @@
SubStmts[TRY] = atTryStmt;
SubStmts[CATCH] = atCatchStmt;
SubStmts[FINALLY] = atFinallyStmt;
- SubStmts[END_TRY] = NULL;
AtTryLoc = atTryLoc;
}