From: Fariborz Jahanian Date: Wed, 7 Nov 2007 17:43:16 +0000 (+0000) Subject: Fixed an array overflow bug. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=89079eac7d6e3091b74b477a4a5ff0cdaf35496c;p=clang 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 28681c6a0a..ccd27afce1 100644 --- a/AST/Stmt.cpp +++ b/AST/Stmt.cpp @@ -206,7 +206,7 @@ Stmt::child_iterator ObjcAtFinallyStmt::child_end() { return &AtFinallyStmt+1; } // 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 10236e1668..7f927b12e1 100644 --- a/include/clang/AST/Stmt.h +++ b/include/clang/AST/Stmt.h @@ -734,7 +734,6 @@ public: : Stmt(ObjcAtCatchStmtClass) { SubExprs[SELECTOR] = catchVarStmtDecl; SubExprs[BODY] = atCatchStmt; - SubExprs[END_EXPR] = NULL; if (!atCatchList) NextAtCatchStmt = NULL; else { @@ -803,8 +802,8 @@ class ObjcAtFinallyStmt : public Stmt { /// @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 @@ public: SubStmts[TRY] = atTryStmt; SubStmts[CATCH] = atCatchStmt; SubStmts[FINALLY] = atFinallyStmt; - SubStmts[END_TRY] = NULL; AtTryLoc = atTryLoc; }