[Issue 14126] GITHEAD - GC seemingly corrupting memory

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Wed Feb 4 19:58:32 PST 2015


https://issues.dlang.org/show_bug.cgi?id=14126

--- Comment #2 from Puneet Goel <puneet at coverify.org> ---
Reducing further.
Does not print "End of main" now.

////
import std.stdio;
import std.conv;
class FooBar {
  private Foo[] _foos;
  this() {
    _foos.length = 512;
  }
}
struct Foo {
  private uint _foo = 1;
  ~this() {
    if (_foo != 1) {
      writeln("How can _foo have any other value than 0 or 1?");
      writeln(_foo, "?? really????");
      assert(false, "Unexpected Value: " ~ _foo.to!string());
    }
  }
}
void main() {
  auto bar = new FooBar();
  writeln("End of main");
}

--


More information about the Digitalmars-d-bugs mailing list