diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2007-11-07 17:43:16 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2007-11-07 17:43:16 +0000 |
commit | 8a348705a81f9666013f914a1d62de799a6cb9d7 (patch) | |
tree | 325103cee6fca36631e49c05c6927ca7c5fb9805 | |
parent | e044087b56696d39ab893c85f223cedb674cc6d5 (diff) | |
download | bcm5719-llvm-8a348705a81f9666013f914a1d62de799a6cb9d7.tar.gz bcm5719-llvm-8a348705a81f9666013f914a1d62de799a6cb9d7.zip |
Fixed an array overflow bug.
llvm-svn: 43826
-rw-r--r-- | clang/AST/Stmt.cpp | 2 | ||||
-rw-r--r-- | clang/include/clang/AST/Stmt.h | 6 |
2 files changed, 3 insertions, 5 deletions
diff --git a/clang/AST/Stmt.cpp b/clang/AST/Stmt.cpp index 28681c6a0a7..ccd27afce15 100644 --- a/clang/AST/Stmt.cpp +++ b/clang/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/clang/include/clang/AST/Stmt.h b/clang/include/clang/AST/Stmt.h index 10236e16681..7f927b12e13 100644 --- a/clang/include/clang/AST/Stmt.h +++ b/clang/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; } |