void main() {} static int x = f(); static int f() out // or in, not body { label: foreach (i; 0..1) { break label; // doesn't work. //break; // works. //continue label; // doesn't work. //continue; // works. } } body { return 1; } compiling the code above outputs: > Assertion failure: 'label && label->statement' on line 1166 in file 'interpret.c' > > abnormal program termination
> the code above If -release, it compiles. And below compiles as well: void main() {} static int x = f(); static int f() out { g(); } body { return 1; } void g() { label: foreach (i; 0..1) { continue label; } }
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/0977ba488d1c7a5257ed79cd0ac4bf41c3a425c5 fix Issue 8865 - Assertion failure: on line 1166 in interpret.c For CTFE, add prefix to the labels in contracts. https://github.com/D-Programming-Language/dmd/commit/4c67f3a58c34250d82296f0712afb0b86a6d7ab2 Merge pull request #1232 from 9rnsr/fix8865 Issue 8865 - Assertion failure: on line 1166 in interpret.c
https://github.com/D-Programming-Language/dmd/pull/1232
Fixed D2
D1 is not supported anymore.