Ambiguous mangling of symbols declared in nested scopes

H. S. Teoh via Digitalmars-d digitalmars-d at puremagic.com
Wed Jul 16 11:18:56 PDT 2014


On Wed, Jul 16, 2014 at 05:36:45PM +0000, Ivan Kazmenko via Digitalmars-d wrote:
> On Wednesday, 16 July 2014 at 17:24:27 UTC, H. S. Teoh via Digitalmars-d
> wrote:
> >Today I was investigating this bug:
> >
> >https://issues.dlang.org/show_bug.cgi?id=10619
> >
> >and found that the problem appears to be an ambiguous mangling of
> >local variables declared in nested scopes. <...>
> 
> Amazing how such a bug survived until now!

Well, I found out about it last year and filed a bug, but it seems to
have escaped everyone's attention. Prior to that, a friend of mine who
occasionally dabbles in D has seen the problem, I don't know how long
ago. It makes me wonder if others may have seen it too, but only haven't
spoken up about it. :-/

In any case, I've been wanting to familiarize myself more with dmd code,
so this is as good an opportunity as any other. Plus, I'm tired of
waiting around for somebody more familiar with dmd to take notice, so I
decided that I'm gonna do something about it myself, even if it means
taking longer 'cos right now I've no idea what I'm doing. :-P


> Can all (meaningful) scopes of a module be numbered internally to
> distinguish them?  Some way, like lambdas are.  Or is it too much of a
> change?
> If they can, the scope's unique ID can then go into the mangled name.
[...]

Ultimately we'll have to do something like that, I think, since I can't
think of any other way to disambiguate between all these local
variables.

But maybe some of the DMD experts can speak up about this. ;-)


T

-- 
Freedom: (n.) Man's self-given right to be enslaved by his own depravity.


More information about the Digitalmars-d mailing list