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
diff --git a/lib/AST/Stmt.cpp b/lib/AST/Stmt.cpp
index 6d8ebcf..f89e2f4 100644
--- a/lib/AST/Stmt.cpp
+++ b/lib/AST/Stmt.cpp
@@ -170,9 +170,8 @@
: 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())