digitalmars.D.bugs - [Issue 1286] New: crash on invariant struct member function referencing globals
- d-bugmail puremagic.com (35/35) Jun 23 2007 http://d.puremagic.com/issues/show_bug.cgi?id=1286
- d-bugmail puremagic.com (9/9) Jun 27 2007 http://d.puremagic.com/issues/show_bug.cgi?id=1286
http://d.puremagic.com/issues/show_bug.cgi?id=1286 Summary: crash on invariant struct member function referencing globals Product: D Version: 2.000 Platform: PC OS/Version: Windows Status: NEW Keywords: ice-on-valid-code Severity: critical Priority: P2 Component: DMD AssignedTo: bugzilla digitalmars.com ReportedBy: lutger.blijdestijn gmail.com When an invariant member function of an invariant struct uses global or static member variables, the compiler crashes. This happens only when this function is invoked more than once. See the code below. int bar; struct Foo { invariant int func() { return bar; } } void main() { invariant(Foo) foo; printf("%d", foo.func()); /* uncomment this line and the compiler aborts with: Assertion failure: 'ito->isInvariant()' on line 335 in file 'mtype.c' */ //printf("%d", foo.func()); } --
Jun 23 2007
http://d.puremagic.com/issues/show_bug.cgi?id=1286 bugzilla digitalmars.com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED ------- Comment #1 from bugzilla digitalmars.com 2007-06-27 20:55 ------- Fixed dmd 2.001 --
Jun 27 2007