Bug 10727 – Regression (dmd-2.061) -- DMD dumps core

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-07-29T06:29:00Z
Last change time
2013-12-15T14:00:36Z
Keywords
ice, pull
Assigned to
nobody
Creator
puneet

Comments

Comment #0 by puneet — 2013-07-29T06:29:40Z
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 by puneet — 2013-07-29T06:34:02Z
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 #2 by k.hara.pg — 2013-07-29T20:55:24Z
Comment #3 by puneet — 2013-07-29T21:42:54Z
(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 by github-bugzilla — 2013-07-30T21:49:19Z
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 by k.hara.pg — 2013-08-06T21:34:10Z
(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 by github-bugzilla — 2013-12-15T14:00:36Z