D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 10727 - Regression (dmd-2.061) -- DMD dumps core
Summary: Regression (dmd-2.061) -- DMD dumps core
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P2 regression
Assignee: No Owner
URL:
Keywords: ice, pull
Depends on:
Blocks:
 
Reported: 2013-07-29 06:29 UTC by Puneet Goel
Modified: 2013-12-15 14:00 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Puneet Goel 2013-07-29 06:29:40 UTC
This regression got introduced in dmd-2.061 (works with dmd-2.060).

$ dmd test.d
dmd: glue.c:1227: virtual unsigned int Type::totym(): Assertion `0' failed.
Aborted (core dumped)
$ cat test.d
import foo;
$ cat foo.d
struct CirBuff(T) {
  import std.traits: isArray;
  CirBuff!T opAssign(R)(R ) if(isArray!R) { }

  struct Range(U,S) {
    Range!(U,S) save() {return U;}
  }

  T[] toArray() {
    T[] ret = new T[this.length];
    return ret;
  }

  alias toArray this;

  Range!(T, T) range() {}

}

class Bar (T=int){
  CirBuff!T _bar;
}

class Once {
  Bar!Foo _foobar;
}

class Foo: Frop {}
Comment 1 Puneet Goel 2013-07-29 06:34:02 UTC
Another interesting testcase. Class Frop is not defined, but DMD fails to catch that. dmd-2.060 works fine.

$ dmd -c test.d # compiles without errors
$ ~/local/dmd-2.060/dmd2/linux/bin64/dmd -c test.d
foo.d(22): Error: undefined identifier Frop
$ cat test.d
import foo;
$ cat foo.d
struct CirBuff(T) {
  import std.traits: isArray;
  CirBuff!T opAssign(R)(R ) if(isArray!R) { }

  T[] toArray() {
    T[] ret = new T[this.length];
    return ret;
  }
  alias toArray this;
}

class Bar (T=int){
  CirBuff!T _bar;
}

class Once {
  Bar!Foo _foobar;
}

class Foo: Frop {}
Comment 3 Puneet Goel 2013-07-29 21:42:54 UTC
(In reply to comment #2)
> https://github.com/D-Programming-Language/dmd/pull/2420

Another testcase (after pulling in the pull request). DMD does not crib about missing override for function Foo.frop. But starts doing that if "alias toArray this" in CirBuff(T) is commented out.

struct CirBuff(T) {
  import std.traits: isArray;
  CirBuff!T opAssign(R)(R ) if(isArray!R) { }

  T[] toArray() {
    T[] ret; //  = new T[this.length];
    return ret;
  }
  alias toArray this;
}

class Bar (T=int){
  CirBuff!T _bar;
}

class Once {
  Bar!Foo _foobar;
}

class Foo: Frop {
  // override
  public int frop() {return 1;}
}

class Frop {
  public int frop() {return 0;}
}
Comment 4 github-bugzilla 2013-07-30 21:49:19 UTC
Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/da18e74c9efef79446506845e6cad9da352a61d7
fix Issue 10727 - Regression (dmd-2.061) -- DMD dumps core

Implicit identity assignment check introduced from 2.061 (instantiate opAssign under error gagging) had gagged undefined identifier error.

https://github.com/D-Programming-Language/dmd/commit/2611985c6a9ad15f7eb76d97738d2f36ab39e767
Merge pull request #2420 from 9rnsr/fix10727

[REG2.061] Issue 10727 - DMD dumps core
Comment 5 Kenji Hara 2013-08-06 21:34:10 UTC
(In reply to comment #3)
> (In reply to comment #2)
> > https://github.com/D-Programming-Language/dmd/pull/2420
> 
> Another testcase (after pulling in the pull request). DMD does not crib about
> missing override for function Foo.frop. But starts doing that if "alias toArray
> this" in CirBuff(T) is commented out.

Moved to: http://d.puremagic.com/issues/show_bug.cgi?id=10768
Comment 6 github-bugzilla 2013-12-15 14:00:36 UTC
Commit pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/e388f762ca9b2ac41131a6f3f564af4259285952
Remove dependency on Phobos from issue 10727 test case