File tree Expand file tree Collapse file tree 3 files changed +8
-13
lines changed
validation-test/compiler_crashers_fixed Expand file tree Collapse file tree 3 files changed +8
-13
lines changed Original file line number Diff line number Diff line change @@ -122,22 +122,17 @@ Parser::parseGenericParameters(SourceLoc LAngleLoc) {
122122
123123 // Parse the closing '>'.
124124 SourceLoc RAngleLoc;
125- if (!startsWithGreater (Tok)) {
125+ if (startsWithGreater (Tok)) {
126+ RAngleLoc = consumeStartingGreater ();
127+ } else {
126128 if (!Invalid) {
127129 diagnose (Tok, diag::expected_rangle_generics_param);
128130 diagnose (LAngleLoc, diag::opening_angle);
129-
130131 Invalid = true ;
131132 }
132-
133+
133134 // Skip until we hit the '>'.
134- skipUntilGreaterInTypeList ();
135- if (startsWithGreater (Tok))
136- RAngleLoc = consumeStartingGreater ();
137- else
138- Invalid = true ;
139- } else {
140- RAngleLoc = consumeStartingGreater ();
135+ RAngleLoc = skipUntilGreaterInTypeList ();
141136 }
142137
143138 if (GenericParams.empty () || Invalid) {
Original file line number Diff line number Diff line change @@ -438,7 +438,7 @@ void Parser::skipUntilAnyOperator() {
438438// / of generic parameters, generic arguments, or list of types in a protocol
439439// / composition.
440440SourceLoc Parser::skipUntilGreaterInTypeList (bool protocolComposition) {
441- SourceLoc lastLoc = Tok. getLoc () ;
441+ SourceLoc lastLoc = PreviousLoc ;
442442 while (true ) {
443443 switch (Tok.getKind ()) {
444444 case tok::eof:
@@ -473,8 +473,8 @@ SourceLoc Parser::skipUntilGreaterInTypeList(bool protocolComposition) {
473473
474474 break ;
475475 }
476- lastLoc = Tok.getLoc ();
477476 skipSingle ();
477+ lastLoc = PreviousLoc;
478478 }
479479}
480480
Original file line number Diff line number Diff line change 55// See http://swift.org/LICENSE.txt for license information
66// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
77
8- // RUN: not --crash %target-swift-frontend %s -parse
8+ // RUN: not %target-swift-frontend %s -parse
99// REQUIRES: asserts
1010{ class
1111func g: protocol<
You can’t perform that action at this time.
0 commit comments