[Issue 1041] regression: incorrect code generation for scope(exit) inside switch

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Aug 12 16:59:42 PDT 2010


http://d.puremagic.com/issues/show_bug.cgi?id=1041



--- Comment #8 from Iain Buclaw <ibuclaw at ubuntu.com> 2010-08-12 16:59:37 PDT ---
Created an attachment (id=715)
quick hack for issue 1041

Attaching a my quick rudimentary kludge. It's not pretty to my eyes, but it
does the job.

What is does, is save the currentScope of SwitchStatement::toIR to
irs->switchStatement. Then when it enters DefaultStatement or CaseStatement,
tests that irs->switchStatement is the parentScope of the itself.

This requires a little extra work in TryFinallyStatement::toIR, I'm happy with
the new code I've added to it, with the exception that I'm rather unsure about
explicitly calling startScope and endScope for it to work correctly with it.
(Although the documentation does say try executes a new ScopeStatement).


Micheal, if you could review it for me - maybe take inspiration and think of a
better approach, would be appreciated. :-)

Thanks.

-- 
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