mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Fix for rdar://problem/19563867, Fuzzing Swift: Parser::parseTopLevel() crashes in Verifier::walkToPatternPost(swift::Pattern*):
a vararg subpattern of a TuplePattern should be a TypedPattern Check for a vararg subpattern to be a typed pattern seemed to be missing in closure arguments parsing. Swift SVN r24733
This commit is contained in:
@@ -540,6 +540,9 @@ mapParsedParameters(Parser &parser,
|
||||
parser.diagnose(param.EllipsisLoc, diag::parameter_ellipsis_not_at_end)
|
||||
.fixItRemove(param.EllipsisLoc);
|
||||
param.EllipsisLoc = SourceLoc();
|
||||
} else if (!isa<TypedPattern>(pattern)) {
|
||||
parser.diagnose(param.EllipsisLoc, diag::untyped_pattern_ellipsis)
|
||||
.highlight(pattern->getSourceRange());
|
||||
} else {
|
||||
ellipsisLoc = param.EllipsisLoc;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user