Got compiler crash in Mangler::mangleFuncType

Stefan Koch via Digitalmars-d digitalmars-d at puremagic.com
Sat Mar 25 10:47:18 PDT 2017


On Saturday, 25 March 2017 at 17:41:49 UTC, Uranuz wrote:
> On Saturday, 25 March 2017 at 17:31:33 UTC, Stefan Koch wrote:
>> On Saturday, 25 March 2017 at 13:34:43 UTC, Uranuz wrote:
>>> On Saturday, 25 March 2017 at 07:57:11 UTC, Stefan Koch wrote:
>>>> [...]
>>>
>>> If you wish to help. You are welcome) I created branch in my 
>>> repository `https://github.com/uranuz/ivy` called 
>>> `v0.1/fail_on_compiler_error`. Seems that error depends on 
>>> the order of source files that were passed to DMD. The way 
>>> that error occurs is using RDMD utility, by running 
>>> command(in project root folder):
>>> rdmd "-Isrc/" -ofsimple_run_test test/simple_run_test.d
>>>
>>> [...]
>>
>> I can reproduce this.
>> The function which fails is:
>> DirAttrsBlock.this(DirAttrKind attrKind, 
>> DirValueAttr!true[string] attrs)
>
> Yes. I fugured out that it fails on this line too. But I don't 
> understand why. Compiler fails on assert and doesn't give any 
> meaningful info about reasons. In release version of compiler 
> it's just segfault. And I don't understand why changing order 
> of source files passed to DMD makes it working... I'm not 
> enough good in knowlege of compiler internals, so it's surprise 
> for me...

It might be that a the particular template does not get 
instantiated if the order is different.
The assert triggers because the constructor is indeed a function 
which returns void.
But at this stage it is not expected to return void.
This is indicative of a compiler bug.



More information about the Digitalmars-d mailing list