From: Bruno Ricci Date: Sun, 28 Oct 2018 14:14:06 +0000 (+0000) Subject: [AST] Fix an use-of-uninitialized bug introduced in CaseStmt X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=85c692702da13e2c7c146477d2621565299198aa;p=clang [AST] Fix an use-of-uninitialized bug introduced in CaseStmt SwitchCaseBits.CaseStmtIsGNURange needs to be initialized first. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@345477 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/AST/Stmt.h b/include/clang/AST/Stmt.h index 3cdd48fca2..3172c706d1 100644 --- a/include/clang/AST/Stmt.h +++ b/include/clang/AST/Stmt.h @@ -975,11 +975,11 @@ class CaseStmt final CaseStmt(Expr *lhs, Expr *rhs, SourceLocation caseLoc, SourceLocation ellipsisLoc, SourceLocation colonLoc) : SwitchCase(CaseStmtClass, caseLoc, colonLoc) { - setLHS(lhs); - setSubStmt(nullptr); // Handle GNU case statements of the form LHS ... RHS. bool IsGNURange = rhs != nullptr; SwitchCaseBits.CaseStmtIsGNURange = IsGNURange; + setLHS(lhs); + setSubStmt(nullptr); if (IsGNURange) { setRHS(rhs); setEllipsisLoc(ellipsisLoc);