Fixed an array overflow bug.

llvm-svn: 43826
This commit is contained in:
Fariborz Jahanian 2007-11-07 17:43:16 +00:00
parent e044087b56
commit 8a348705a8
2 changed files with 3 additions and 5 deletions

View File

@ -206,7 +206,7 @@ Stmt::child_iterator ObjcAtFinallyStmt::child_end() { return &AtFinallyStmt+1; }
// ObjcAtTryStmt // ObjcAtTryStmt
Stmt::child_iterator ObjcAtTryStmt::child_begin() { return &SubStmts[0]; } Stmt::child_iterator ObjcAtTryStmt::child_begin() { return &SubStmts[0]; }
Stmt::child_iterator ObjcAtTryStmt::child_end() { Stmt::child_iterator ObjcAtTryStmt::child_end() {
return &SubStmts[0]+END_TRY; return &SubStmts[0]+END_EXPR;
} }
// ObjcAtThrowStmt // ObjcAtThrowStmt

View File

@ -734,7 +734,6 @@ public:
: Stmt(ObjcAtCatchStmtClass) { : Stmt(ObjcAtCatchStmtClass) {
SubExprs[SELECTOR] = catchVarStmtDecl; SubExprs[SELECTOR] = catchVarStmtDecl;
SubExprs[BODY] = atCatchStmt; SubExprs[BODY] = atCatchStmt;
SubExprs[END_EXPR] = NULL;
if (!atCatchList) if (!atCatchList)
NextAtCatchStmt = NULL; NextAtCatchStmt = NULL;
else { else {
@ -803,8 +802,8 @@ class ObjcAtFinallyStmt : public Stmt {
/// @try ... @catch ... @finally statement. /// @try ... @catch ... @finally statement.
class ObjcAtTryStmt : public Stmt { class ObjcAtTryStmt : public Stmt {
private: private:
enum { TRY, CATCH, FINALLY, END_TRY }; enum { TRY, CATCH, FINALLY, END_EXPR };
Stmt* SubStmts[END_TRY]; Stmt* SubStmts[END_EXPR];
SourceLocation AtTryLoc; SourceLocation AtTryLoc;
@ -816,7 +815,6 @@ public:
SubStmts[TRY] = atTryStmt; SubStmts[TRY] = atTryStmt;
SubStmts[CATCH] = atCatchStmt; SubStmts[CATCH] = atCatchStmt;
SubStmts[FINALLY] = atFinallyStmt; SubStmts[FINALLY] = atFinallyStmt;
SubStmts[END_TRY] = NULL;
AtTryLoc = atTryLoc; AtTryLoc = atTryLoc;
} }