[dmd-internals] A major root-cause bug

Walter Bright walter at digitalmars.com
Sun Nov 14 09:56:30 PST 2010


I actually think it is urgent. I've found and fixed the particular 
problem. But you're right, there is a more general problem. I want to 
switch out the way it does semantic analysis from the way it's done now, 
eagerly, to a lazy method. By lazy I mean it does the semantic analysis 
of symbols as required. This should eliminate all the forward reference 
issues.

Don Clugston wrote:
> To clarify -- this bug is not urgent, but it's one that I think we
> need to be aware of, because it can have such a wide and unexpected
> influence.
>
> On 13 November 2010 05:16, Don Clugston <dclugston at googlemail.com> wrote:
>   
>> While tracking down an ICE bug, I found this important issue.
>>
>> 5195 Forward references ignore const
>>
>> Most of the front-end uses the 'type' member of a variable to check,
>> and assumes that if it's non-null,
>> it hasn't been forward referenced.
>> The problem is, if x is declared as  'const int *x' or  'const { int
>> *x; }' , it has a non-null type member, but it doesn't have the const
>> yet!
>> This bogus type is a root of all kinds of evil. It manifests in a
>> variety of weird ways.
>> I think that several previously fixed bugs, were just special cases of this one.
>>
>> Unfortunately fixing this isn't just a one-liner. It requires a minor
>> structural change, and I'm not sure which approach is the best way of
>> fixing it.
>> Essentially, all the qualifiers need to be resolved before any other
>> semantic analysis takes place.
>> Walter, can you comment?
>>
>>     
> _______________________________________________
> dmd-internals mailing list
> dmd-internals at puremagic.com
> http://lists.puremagic.com/mailman/listinfo/dmd-internals
>
>
>   


More information about the dmd-internals mailing list