aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/Stmt.cpp
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2008-05-25 04:34:57 +0000
committerEli Friedman <eli.friedman@gmail.com>2008-05-25 04:34:57 +0000
commit0613c37d7914672585e67bedd18d9a1588104360 (patch)
tree6098eb0ac06cda6e555492bd4f88d2599276d162 /lib/AST/Stmt.cpp
parent39165e2a19657414d65aad082ffa8196f4a8cdc6 (diff)
Always initialize NEXT_CATCH; fixes a Valgrind uninitialized read error
(originally reported in PR1682). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51551 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/Stmt.cpp')
-rw-r--r--lib/AST/Stmt.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/AST/Stmt.cpp b/lib/AST/Stmt.cpp
index 6d8ebcf864..f89e2f40fa 100644
--- a/lib/AST/Stmt.cpp
+++ b/lib/AST/Stmt.cpp
@@ -170,9 +170,8 @@ ObjCAtCatchStmt::ObjCAtCatchStmt(SourceLocation atCatchLoc,
: Stmt(ObjCAtCatchStmtClass) {
SubExprs[SELECTOR] = catchVarStmtDecl;
SubExprs[BODY] = atCatchStmt;
- if (!atCatchList)
- SubExprs[NEXT_CATCH] = NULL;
- else {
+ SubExprs[NEXT_CATCH] = NULL;
+ if (atCatchList) {
ObjCAtCatchStmt *AtCatchList = static_cast<ObjCAtCatchStmt*>(atCatchList);
while (ObjCAtCatchStmt* NextCatch = AtCatchList->getNextCatchStmt())