[dmd-internals] Asserts

David Nadlinger code at klickverbot.at
Sun Nov 11 14:04:07 PST 2012


On 11 Nov 2012, at 20:50, Walter Bright wrote:
> What has also helped is refactoring. For example, the code to walk the 
> expression trees tends to be duplicated a lot. By switching to a 
> single walker coupled with an "apply" function, a number of latent 
> bugs were fixed. I'd like to see more of this (see src/apply.c).

On a related note, and sorry to ping you about this again: Could you 
please have a look at http://d.puremagic.com/issues/show_bug.cgi?id=8957 
resp. my »Expression::apply, DeclarationExp and a possible nested 
context bug« thread on this mailing list 
(http://forum.dlang.org/thread/CAP9J_HXG8mTtnojU9YwYuSGZp1NQCdY0+7oeHyoQ2WhNR-dAuw@mail.gmail.com)?

The question is whether Expression::apply should visit expressions 
evaluated as part of a DeclarationExp (i.e. initializers). I had to 
implement a workaround for this in LDC, since it causes an outright 
crash in its nested context creation code while for DMD the issue is 
just a rather obscure wrong-code bug, but from past experience I'd like 
to avoid unilaterally messing with the frontend as much as possible.

David


More information about the dmd-internals mailing list