digitalmars.D - DMD Access Violation
- Jonathan Marler (38/38) Sep 26 2016 My dmd compiler gets an Access Violation when compiling this code:
- Stefan Koch (4/44) Sep 26 2016 Cyclic dependency.
- Jonathan Marler (6/11) Sep 26 2016 Well I'm not sure if it's a bug with the main compiler or my own
- ag0aep6g (12/25) Sep 26 2016 With the change above, dmd 2.071.2 crashes with an assertion failure:
- Jonathan Marler (3/32) Sep 26 2016 Thanks for the info. I'll have to update my compiler to master,
- ag0aep6g (3/5) Sep 26 2016 You'd have to go back to a 2.070 version. The 2.071 versions all crash
My dmd compiler gets an Access Violation when compiling this code: public template TemplateWrapper(T) { alias ToAlias = T; } public class Bar : Foo { TemplateWrapper!(Bar) something; } public class Foo { static class StaticClass : Bar { } } If I move Foo to appear before Bar, the AccessViolation goes away: public template TemplateWrapper(T) { alias ToAlias = T; } public class Foo { static class StaticClass : Bar { } } public class Bar : Foo { TemplateWrapper!(Bar) something; } Also, if I remove the TemplateWrapper, the AccessViolation goes away: public class Bar : Foo { Bar something; } public class Foo { static class StaticClass : Bar { } } Does anyone else get an access violation in the first case? Is this a known bug?
Sep 26 2016
On Monday, 26 September 2016 at 18:07:44 UTC, Jonathan Marler wrote:My dmd compiler gets an Access Violation when compiling this code: public template TemplateWrapper(T) { alias ToAlias = T; } public class Bar : Foo { TemplateWrapper!(Bar) something; } public class Foo { static class StaticClass : Bar { } } If I move Foo to appear before Bar, the AccessViolation goes away: public template TemplateWrapper(T) { alias ToAlias = T; } public class Foo { static class StaticClass : Bar { } } public class Bar : Foo { TemplateWrapper!(Bar) something; } Also, if I remove the TemplateWrapper, the AccessViolation goes away: public class Bar : Foo { Bar something; } public class Foo { static class StaticClass : Bar { } } Does anyone else get an access violation in the first case? Is this a known bug?Cyclic dependency. File a dmd bug please.
Sep 26 2016
On Monday, 26 September 2016 at 18:23:33 UTC, Stefan Koch wrote:On Monday, 26 September 2016 at 18:07:44 UTC, Jonathan MarlerWell I'm not sure if it's a bug with the main compiler or my own build. The Access Violation doesn't seem to happen on one of my rigs, but it does with the other, and that one is using a custom build of DMD...just wanted to see if anyone else's DMD also has the bug.Does anyone else get an access violation in the first case? Is this a known bug?Cyclic dependency. File a dmd bug please.
Sep 26 2016
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.
Sep 26 2016
On Monday, 26 September 2016 at 18:49:58 UTC, ag0aep6g wrote:On 09/26/2016 08:07 PM, Jonathan Marler wrote:Thanks for the info. I'll have to update my compiler to master, or go back to 2.071.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.
Sep 26 2016
On 09/26/2016 08:53 PM, Jonathan Marler wrote:Thanks for the info. I'll have to update my compiler to master, or go back to 2.071.You'd have to go back to a 2.070 version. The 2.071 versions all crash on your code.
Sep 26 2016