D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 16237 - Some DMD Assertion Failures
Summary: Some DMD Assertion Failures
Status: RESOLVED WORKSFORME
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86_64 Linux
: P1 normal
Assignee: No Owner
URL:
Keywords: ice
Depends on:
Blocks:
 
Reported: 2016-07-05 08:52 UTC by Puneet Goel
Modified: 2020-03-21 03:56 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Puneet Goel 2016-07-05 08:52:40 UTC
DMD crashes with assertion failure:

$ dmd -c test.d
core.exception.AssertError@todt.d(795): Assertion failure

Also if we comment out line 14, we get:

$ dmd -c test.d
dmd: toobj.c:358: virtual void toObjFile(Dsymbol*, bool)::ToObjFile::visit(ClassDeclaration*): Assertion `cd->structsize >= 8 || (cd->cpp && cd->structsize >= 4)' failed.
Aborted


class Foo(L) {			    // 1
  FooFoo!L foofoo;		    // 2
  alias U = typeof(frop);	    // 3
  Object obj = null;		    // 4
  auto frop() {			    // 5
    foofoo.frop;		    // 6
  }				    // 7
}				    // 8
class FooFooFoo(M) {		    // 9
  alias Zoo = Foo!(M);		    // 10
}				    // 11
class FooFoo(M) : FooFooFoo!(M) {   // 12
  bool frop() {return false;}	    // 13
  Zoo zoo() {return new Zoo;}	    // 14
}				    // 15
class Bar {			    // 16
  class Solver {		    // 17
    auto boo(L)(L l) {		    // 18
      new FooFoo!L();		    // 19
    }				    // 20
    void bar() {		    // 21
      boo(foo);			    // 22
    }				    // 23
  }				    // 24
  byte[] foo ;			    // 25
}				    // 26
Comment 1 hsteoh 2016-09-02 16:12:19 UTC
Can't reproduce on git HEAD. Tested on Linux/64. Perhaps this has been fixed since?
Comment 2 basile-z 2019-02-28 17:13:39 UTC
Yes, fixed at some point, see https://run.dlang.io/is/SdERou