Thread overview | ||||||||
---|---|---|---|---|---|---|---|---|
|
December 19, 2019 [Issue 20458] CRTP + pass alias to virtual member to mixin = runtime crash | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=20458 hsteoh@quickfur.ath.cx changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |hsteoh@quickfur.ath.cx -- |
December 17, 2022 [Issue 20458] CRTP + pass alias to virtual member to mixin = runtime crash | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=20458 Iain Buclaw <ibuclaw@gdcproject.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Priority|P1 |P3 -- |
March 22, 2023 [Issue 20458] CRTP + pass alias to virtual member to mixin = runtime crash | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=20458 Basile-z <b2.temp@gmx.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |b2.temp@gmx.com --- Comment #1 from Basile-z <b2.temp@gmx.com> --- With assertions built in DMD your code triggers this : https://github.com/dlang/dmd/blob/498822ec8efb8e2b68e257b01fa1e097ec6e3a88/compiler/src/dmd/dsymbolsem.d#L5261, so the vtbl seems to be started already, probably with "test" but then is rebuild again, without -- |
March 22, 2023 [Issue 20458] CRTP + pass alias to virtual member to mixin = runtime crash | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=20458 --- Comment #2 from Basile-z <b2.temp@gmx.com> --- reduced further ``` mixin template Impl(T){ alias a = __traits(getMember, T, "test"); //alias a = T.test; // no vtbl corruption with this alias } class A(T) { mixin Impl!T; } class Foo : A!Foo { void test() {} } void main() { (new Foo).test(); } ``` -- |
March 23, 2023 [Issue 20458] CRTP + pass alias to virtual member to mixin = runtime crash | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=20458 --- Comment #3 from Basile-z <b2.temp@gmx.com> --- The same corruption without the getMember trait: ``` mixin template Impl(T){ alias a = T.test; pragma(msg, typeof(a)); // launch dsymbolsema and corrupt vtbl } class A(T) { mixin Impl!T; } class Foo : A!Foo { void test() {} } void main() { (new Foo).test(); } ``` -- |
March 23, 2023 [Issue 20458] CRTP + pass alias to virtual member to mixin = runtime crash | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=20458 --- Comment #4 from Basile-z <b2.temp@gmx.com> --- Finally the generic reproduction ``` class Base { alias a = Derived.test; pragma(msg, typeof(a)); // triggers the vtbl corruption } class Derived : Base { void test(){} } void main() { (new Derived).test(); } ``` -- |
Copyright © 1999-2021 by the D Language Foundation