diff options
author | Steve Naroff <snaroff@apple.com> | 2008-05-07 17:35:03 +0000 |
---|---|---|
committer | Steve Naroff <snaroff@apple.com> | 2008-05-07 17:35:03 +0000 |
commit | 1a42a2550a2db937ab3df863b771f13be34b66d6 (patch) | |
tree | 10bbe8a4514c4066e34308245fb0414948a39184 /lib/AST/Expr.cpp | |
parent | 81e72e4c231a47633e36a6c2f3ded83630963b3f (diff) |
Fixup InitListExpr::child_begin/end. Thanks to Ted for catching the regression.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50816 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/Expr.cpp')
-rw-r--r-- | lib/AST/Expr.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/AST/Expr.cpp b/lib/AST/Expr.cpp index cad6065e2e..90b8530339 100644 --- a/lib/AST/Expr.cpp +++ b/lib/AST/Expr.cpp @@ -1366,10 +1366,12 @@ Stmt::child_iterator VAArgExpr::child_end() { // InitListExpr Stmt::child_iterator InitListExpr::child_begin() { - return reinterpret_cast<Stmt**>(&InitExprs[0]); + return reinterpret_cast<Stmt**>(InitExprs.size() ? + &InitExprs[0] : 0); } Stmt::child_iterator InitListExpr::child_end() { - return reinterpret_cast<Stmt**>(&InitExprs[getNumInits()-1]); + return reinterpret_cast<Stmt**>(InitExprs.size() ? + &InitExprs[0] + InitExprs.size() : 0); } // ObjCStringLiteral |