DMD Access Violation

Jonathan Marler via Digitalmars-d digitalmars-d at puremagic.com
Mon Sep 26 11:53:07 PDT 2016


On Monday, 26 September 2016 at 18:49:58 UTC, ag0aep6g wrote:
> On 09/26/2016 08:07 PM, Jonathan Marler wrote:
>> My dmd compiler gets an Access Violation when compiling this 
>> code:
>>
>>     public template TemplateWrapper(T)
>>     {
>>         alias ToAlias = T;
>
> Should probably be `alias TemplateWrapper = T;`.
>
>>     }
>>     public class Bar : Foo
>>     {
>>         TemplateWrapper!(Bar) something;
>>     }
>>     public class Foo
>>     {
>>         static class StaticClass : Bar { }
>>     }
>
> With the change above, dmd 2.071.2 crashes with an assertion 
> failure:
>
> toobj.c:352: virtual void toObjFile(Dsymbol*, 
> bool)::ToObjFile::visit(ClassDeclaration*): Assertion 
> `cd->structsize >= 8 || (cd->cpp && cd->structsize >= 4)' 
> failed.
>
> Current master dmd (04e6a6e) doesn't crash. Maybe the bug has 
> already been fixed.
>
> Reminds me of this issue:
> https://issues.dlang.org/show_bug.cgi?id=16273
> Similar setup, but opposite results: crashes with master and 
> works with 2.071.

Thanks for the info.  I'll have to update my compiler to master, 
or go back to 2.071.


More information about the Digitalmars-d mailing list