File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -7432,7 +7432,8 @@ bool SILParserState::parseSILGlobal(Parser &P) {
7432
7432
if (State.P .consumeIf (tok::equal) && State.P .consumeIf (tok::l_brace)) {
7433
7433
SILBuilder B (GV);
7434
7434
do {
7435
- State.parseSILInstruction (B);
7435
+ if (State.parseSILInstruction (B))
7436
+ return true ;
7436
7437
} while (! State.P .consumeIf (tok::r_brace));
7437
7438
}
7438
7439
return false ;
Original file line number Diff line number Diff line change
1
+ // RUN: %target-sil-opt -inline -verify %s
2
+
3
+ // Check that the parser doesn't end up in an infinite error loop in case there is an error in a sil_global
4
+
5
+ sil_stage canonical
6
+
7
+ import Builtin
8
+ import Swift
9
+ import SwiftShims
10
+
11
+ sil_global @referencing_object : $Int = {
12
+ %initval = struct $Int_ ()
13
+ // expected-error @-1 {{cannot find type 'Int_' in scope}}
14
+ }
15
+
You can’t perform that action at this time.
0 commit comments