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) {
74327432 if (State.P .consumeIf (tok::equal) && State.P .consumeIf (tok::l_brace)) {
74337433 SILBuilder B (GV);
74347434 do {
7435- State.parseSILInstruction (B);
7435+ if (State.parseSILInstruction (B))
7436+ return true ;
74367437 } while (! State.P .consumeIf (tok::r_brace));
74377438 }
74387439 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