Skip to content

Commit a20a4da

Browse files
jijoongmoondtarditi
authored andcommitted
Fix Return value of ParseRelativeBoundsForDecl not being used (#282) (#285)
If ParseRelativeBoundsForDecl returns an error, make sure to make bounds expression to which it was supposed to be attached invalid.
1 parent 20b6b09 commit a20a4da

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/Parse/ParseExpr.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2841,7 +2841,9 @@ ExprResult Parser::ParseBoundsExpressionOrInteropType(const Declarator &D,
28412841

28422842
TempTok = Tok;
28432843
if (StartsRelativeBoundsClause(Tok))
2844-
ParseRelativeBoundsClauseForDecl(Result);
2844+
if (ParseRelativeBoundsClauseForDecl(Result)) {
2845+
Result = ExprError();
2846+
}
28452847

28462848
return Result;
28472849
}
@@ -2977,7 +2979,6 @@ bool Parser::ParseRelativeBoundsClauseForDecl(ExprResult &Expr) {
29772979
ParseRelativeBoundsClause(isError, Ident, BoundsKWLoc);
29782980

29792981
if (Expr.isInvalid()) {
2980-
isError = true;
29812982
return isError;
29822983
}
29832984

0 commit comments

Comments
 (0)