Mercurial > projects > ldc
changeset 901:d51551cb3a85
Fix #174.
author | Christian Kamm <kamm incasoftware de> |
---|---|
date | Thu, 22 Jan 2009 21:46:40 +0100 |
parents | 177afbf5297b |
children | 893d72ab95d0 |
files | dmd/statement.c tests/mini/compile_bug174_enclosing_on_break.d |
diffstat | 2 files changed, 11 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/dmd/statement.c Thu Jan 22 18:53:32 2009 +0100 +++ b/dmd/statement.c Thu Jan 22 21:46:40 2009 +0100 @@ -2334,7 +2334,12 @@ 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);