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) {
122
122
123
123
// Parse the closing '>'.
124
124
SourceLoc RAngleLoc;
125
- if (!startsWithGreater (Tok)) {
125
+ if (startsWithGreater (Tok)) {
126
+ RAngleLoc = consumeStartingGreater ();
127
+ } else {
126
128
if (!Invalid) {
127
129
diagnose (Tok, diag::expected_rangle_generics_param);
128
130
diagnose (LAngleLoc, diag::opening_angle);
129
-
130
131
Invalid = true ;
131
132
}
132
-
133
+
133
134
// 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 ();
141
136
}
142
137
143
138
if (GenericParams.empty () || Invalid) {
Original file line number Diff line number Diff line change @@ -438,7 +438,7 @@ void Parser::skipUntilAnyOperator() {
438
438
// / of generic parameters, generic arguments, or list of types in a protocol
439
439
// / composition.
440
440
SourceLoc Parser::skipUntilGreaterInTypeList (bool protocolComposition) {
441
- SourceLoc lastLoc = Tok. getLoc () ;
441
+ SourceLoc lastLoc = PreviousLoc ;
442
442
while (true ) {
443
443
switch (Tok.getKind ()) {
444
444
case tok::eof:
@@ -473,8 +473,8 @@ SourceLoc Parser::skipUntilGreaterInTypeList(bool protocolComposition) {
473
473
474
474
break ;
475
475
}
476
- lastLoc = Tok.getLoc ();
477
476
skipSingle ();
477
+ lastLoc = PreviousLoc;
478
478
}
479
479
}
480
480
Original file line number Diff line number Diff line change 5
5
// See http://swift.org/LICENSE.txt for license information
6
6
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
7
7
8
- // RUN: not --crash %target-swift-frontend %s -parse
8
+ // RUN: not %target-swift-frontend %s -parse
9
9
// REQUIRES: asserts
10
10
{ class
11
11
func g: protocol<
You can’t perform that action at this time.
0 commit comments