mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-02-27 00:53:23 +01:00
Fix #174.
This commit is contained in:
@@ -2334,7 +2334,12 @@ Statement *SwitchStatement::semantic(Scope *sc)
|
||||
|
||||
a->reserve(4);
|
||||
a->push(body);
|
||||
a->push(new BreakStatement(loc, NULL));
|
||||
|
||||
// LDC needs semantic to be run on break
|
||||
Statement *breakstmt = new BreakStatement(loc, NULL);
|
||||
breakstmt->semantic(sc);
|
||||
a->push(breakstmt);
|
||||
|
||||
sc->sw->sdefault = new DefaultStatement(loc, s);
|
||||
a->push(sc->sw->sdefault);
|
||||
cs = new CompoundStatement(loc, a);
|
||||
|
||||
5
tests/mini/compile_bug174_enclosing_on_break.d
Normal file
5
tests/mini/compile_bug174_enclosing_on_break.d
Normal file
@@ -0,0 +1,5 @@
|
||||
void main()
|
||||
{
|
||||
scope Object o;
|
||||
switch(0) {}
|
||||
}
|
||||
Reference in New Issue
Block a user