]> granicus.if.org Git - clang/commitdiff
Fixed an array overflow bug.
authorFariborz Jahanian <fjahanian@apple.com>
Wed, 7 Nov 2007 17:43:16 +0000 (17:43 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Wed, 7 Nov 2007 17:43:16 +0000 (17:43 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43826 91177308-0d34-0410-b5e6-96231b3b80d8

AST/Stmt.cpp
include/clang/AST/Stmt.h

index 28681c6a0a7079089b4f820edc7ea64867ffe86b..ccd27afce153b75ec6068cc124ced3e3f6d32581 100644 (file)
@@ -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
index 10236e16681f08fcc6d08f8cf2f60e7b324da05a..7f927b12e13dde5ff4c3f7c8446582babef0fb8e 100644 (file)
@@ -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;
     }