Re: Ambiguous mangling of symbols declared in nested scopes

2014-07-18 Thread Daniel Murphy via Digitalmars-d
H. S. Teoh via Digitalmars-d wrote in message news:mailman.4366.1405642929.2907.digitalmar...@puremagic.com... Hmm. How to generate a unique id? It must be module-wide, but not program-wide, because otherwise you get a different mangling depending on the order of imports. It must not

Re: Ambiguous mangling of symbols declared in nested scopes

2014-07-17 Thread Daniel Murphy via Digitalmars-d
H. S. Teoh via Digitalmars-d wrote in message news:mailman.4230.1405534833.2907.digitalmar...@puremagic.com... But maybe some of the DMD experts can speak up about this. ;-) This is fairly well known, the same thing exists for static variables and nested functions etc. I think there is

Re: Ambiguous mangling of symbols declared in nested scopes

2014-07-17 Thread Dicebot via Digitalmars-d
Slight correction : it is not a mangling of variable that is a problem (local variables don't have any mangling) but mangling of the function itself (it naively uses variable name for mangled name generation). Should use something like unique id instead.

Re: Ambiguous mangling of symbols declared in nested scopes

2014-07-17 Thread David Nadlinger via Digitalmars-d
On Thursday, 17 July 2014 at 10:03:08 UTC, Daniel Murphy wrote: The solution is also fairly straightforward - give each local declaration a unique name (for mangling only). It probably requires some minor structural changes in dmd. As an aside, these names should be independent of

Re: Ambiguous mangling of symbols declared in nested scopes

2014-07-17 Thread Sean Kelly via Digitalmars-d
I opened a number of bugs regarding ambiguities while writing core.demangle. They're all tagged with some searchable keyword too, though I can't recall what it is.

Re: Ambiguous mangling of symbols declared in nested scopes

2014-07-17 Thread H. S. Teoh via Digitalmars-d
On Thu, Jul 17, 2014 at 10:15:56AM +, Dicebot via Digitalmars-d wrote: Slight correction : it is not a mangling of variable that is a problem (local variables don't have any mangling) but mangling of the function itself (it naively uses variable name for mangled name generation). Should

Re: Ambiguous mangling of symbols declared in nested scopes

2014-07-17 Thread Dicebot via Digitalmars-d
Something like reduced hash from mangled name of parent scope + incremental ID for each new stack instance.

Re: Ambiguous mangling of symbols declared in nested scopes

2014-07-16 Thread Ivan Kazmenko via Digitalmars-d
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

Re: Ambiguous mangling of symbols declared in nested scopes

2014-07-16 Thread H. S. Teoh via Digitalmars-d
On Wed, Jul 16, 2014 at 05:36:45PM +, 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