November 30, 2008 [Issue 2481] New: mixing field into anonymous struct inside class generates field overlapping vtable | ||||
---|---|---|---|---|
| ||||
http://d.puremagic.com/issues/show_bug.cgi?id=2481 Summary: mixing field into anonymous struct inside class generates field overlapping vtable Product: D Version: 1.035 Platform: PC OS/Version: Linux Status: NEW Keywords: wrong-code Severity: major Priority: P2 Component: DMD AssignedTo: bugzilla@digitalmars.com ReportedBy: tomas@famolsen.dk template M() { int i; } class Z { struct { mixin M!(); } } void main() { Z z; writefln(z.i.offsetof); } // output: 0 dmd uses offset=0 internally, meaning that if 'i' is written to, the vtable is overwritten. -- |
November 30, 2008 [Issue 2481] mixing field into anonymous struct inside class generates field overlapping vtable | ||||
---|---|---|---|---|
| ||||
Posted in reply to d-bugmail | http://d.puremagic.com/issues/show_bug.cgi?id=2481 ------- Comment #1 from tomas@famolsen.dk 2008-11-30 13:16 ------- same problem happens if an anonymous union block is used instead -- |
Copyright © 1999-2021 by the D Language Foundation