mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[SyntaxParse] Fix ASAN issue
rdar://problem/55711699 rdar://problem/55711787 rdar://problem/55711952
This commit is contained in:
@@ -73,12 +73,17 @@ Parser::parseGenericParameterClauseSyntax() {
|
||||
|
||||
// Parse attributes.
|
||||
// TODO: Implement syntax attribute parsing.
|
||||
DeclAttributes attrsAST;
|
||||
parseDeclAttributeList(attrsAST);
|
||||
auto attrs = SyntaxContext->popIf<ParsedAttributeListSyntax>();
|
||||
if (attrs) {
|
||||
paramBuilder.useAttributes(std::move(*attrs));
|
||||
Generator.addDeclAttributes(attrsAST, attrsAST.getStartLoc());
|
||||
if (Tok.is(tok::at_sign)) {
|
||||
SyntaxParsingContext TmpCtxt(SyntaxContext);
|
||||
TmpCtxt.setTransparent();
|
||||
|
||||
DeclAttributes attrsAST;
|
||||
parseDeclAttributeList(attrsAST);
|
||||
if (!attrsAST.isEmpty())
|
||||
Generator.addDeclAttributes(attrsAST, attrsAST.getStartLoc());
|
||||
auto attrs = SyntaxContext->popIf<ParsedAttributeListSyntax>();
|
||||
if (attrs)
|
||||
paramBuilder.useAttributes(std::move(*attrs));
|
||||
}
|
||||
|
||||
// Parse the name of the parameter.
|
||||
|
||||
Reference in New Issue
Block a user