This is most likely related to something done for Issue 4339. void main() { goto L1; try { L1: int a; } catch { } } produces: Internal error: ../ztc/cgcod.c 989 This is a regression, as the error "test.d(6): Error: cannot goto forward into different try block level" is raised in 1.062. Note that moving the "goto L1;" line below the try/catch/finally produces the error "test.d(9): Error: cannot goto into try block" on both dmd 1.062 and 1.063.
It may also be related to Issue 235. The code posted there has the same behaviour as what is posted here.
Silly mistake in the implementation of forward references, in the patch for 4339. It remembers the block the label is in, when it should be recording the block which it was referenced from. PATCH: s2ir.c, line 107, labelToBlock() // Keep track of the forward reference to this block, so we can check it later if (!s->fwdrefs) s->fwdrefs = new Array(); - s->fwdrefs->push(s->lblock); + s->fwdrefs->push(blx->curblock); } } return s->lblock;
http://www.dsource.org/projects/dmd/changeset/631
*** Issue 4811 has been marked as a duplicate of this issue. ***