[Issue 1041] regression: incorrect code generation for scope(exit) inside switch
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Wed Aug 11 20:39:10 PDT 2010
http://d.puremagic.com/issues/show_bug.cgi?id=1041
Michael P <baseball.mjp at gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |baseball.mjp at gmail.com
--- Comment #5 from Michael P <baseball.mjp at gmail.com> 2010-08-11 20:39:07 PDT ---
The problem appears to be in DefaultStatement::toIR in d-glue.cc.
The error, "default cannot be in different try block level from switch" is
handled in dmd in s2ir.c, in DefaultStatement::toIR.
DMD:
void DefaultStatement::toIR(IRState *irs)
{
Blockx *blx = irs->blx;
block *bcase = blx->curblock;
block *bdefault = irs->getDefaultBlock();
block_next(blx,BCgoto,bdefault);
list_append(&bcase->Bsucc,blx->curblock);
if (blx->tryblock != irs->getSwitchBlock()->Btry)
error("default cannot be in different try block level from switch");
incUsage(irs, loc);
if (statement)
statement->toIR(irs);
}
GDC:
void
DefaultStatement::toIR(IRState * irs)
{
irs->doCase(NULL_TREE, cblock);
if (statement)
statement->toIR( irs );
}
You can see that GDC does not do the checks that DMD does.
At the moment, I'm not sure how the DMD code translates to what should be in
GDC.
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the D.gnu
mailing list