Thread overview
[Issue 7091] New: ICE in Statement::blockExit
Dec 10, 2011
Trass3r
Dec 10, 2011
Trass3r
Dec 10, 2011
Kenji Hara
Dec 10, 2011
Kenji Hara
Dec 13, 2011
Trass3r
Apr 28, 2012
SomeDude
December 10, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=7091

           Summary: ICE in Statement::blockExit
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: ice-on-invalid-code, ice-on-valid-code
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody@puremagic.com
        ReportedBy: mrmocool@gmx.de


--- Comment #0 from Trass3r <mrmocool@gmx.de> 2011-12-10 11:51:14 PST ---
struct Matrix(T)
{

    int opApply(scope int delegate(ref size_t, ref T) ) { }
    int opApply(scope int delegate(ref const(size_t), ref const(T)) )  { }

    Matrix!() opBinary()    {
        foreach (i, ref val; this)
mixin("result[i] = val " ~ op ~ " other[i];");         return result;
    }
}

void main() { auto m = Matrix!size_t; }

$ dmd -c test2.d
test2.d(7): Error: template instance Matrix!() Matrix!() does not match
template declaration Matrix(T)
test2.d(7): Error: Matrix!() is used as a type
test2.d(4): Error: function test2.Matrix!(ulong).Matrix.opApply has no return
statement, but is expected to return a value of type int
test2.d(5): Error: function test2.Matrix!(ulong).Matrix.opApply has no return
statement, but is expected to return a value of type int
test2.d(8): Error: cannot uniquely infer foreach argument types
test2.d(9): Error: undefined identifier result
Statement::blockExit(0xcd15e0)
mixin("result[i] = val " ~ op ~ " other[i];");

dmd: statement.c:144: virtual int Statement::blockExit(bool): Assertion `0'
failed.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
December 10, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=7091



--- Comment #1 from Trass3r <mrmocool@gmx.de> 2011-12-10 11:52:22 PST ---
more valid case:

struct Matrix(T)
{
    @property T[] data() { return null; }

    int opApply(scope int delegate(ref size_t[], ref T) dg) { return 0; }
    int opApply(scope int delegate(ref const(size_t[]), ref const(T)) dg) const
{ return 0; }

    Matrix!(typeof(mixin("data[0] " ~ op ~ " data[0]"))) opBinary(string
op)(Matrix other)
    {
        auto result = typeof(return)();
        foreach (i, ref val; this)
        { mixin("result[i] = val " ~ op ~ " other[i];"); }
        return result;
    }
}

void main() { auto m = Matrix!size_t(); m = m * m; }


$ dmd -c test2.d
test2.d(11): Error: cannot uniquely infer foreach argument types
Statement::blockExit(0x1c509c0)
mixin("result[i] = val " ~ op ~ " other[i];");

dmd: statement.c:144: virtual int Statement::blockExit(bool): Assertion `0'
failed.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
December 10, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=7091



--- Comment #2 from Kenji Hara <k.hara.pg@gmail.com> 2011-12-10 13:52:48 PST ---
More simple test code:
----
void main()
{
    int[] arr;
    foreach (x, i, v; arr)
    {
        mixin("");
    }
}

output:
----
test.d(4): Error: cannot infer type for i
test.d(4): Error: cannot infer type for v
Statement::blockExit(002B6810)
mixin("");

Assertion failure: '0' on line 144 in file 'statement.c'

abnormal program termination

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
December 10, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=7091


Kenji Hara <k.hara.pg@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|ice-on-valid-code           |patch


--- Comment #3 from Kenji Hara <k.hara.pg@gmail.com> 2011-12-10 14:40:37 PST ---
This problem occurs only on invalid code. So it isn't 'ice-on-valid-code'.

Patch: https://github.com/D-Programming-Language/dmd/pull/553

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
December 13, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=7091


Trass3r <mrmocool@gmx.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


--- Comment #4 from Trass3r <mrmocool@gmx.de> 2011-12-12 18:22:20 PST ---
https://github.com/D-Programming-Language/dmd/commit/1a2277c73f7dcc7d5faf2f17cdcbbc6e801f16e8

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
April 28, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7091


SomeDude <lovelydear@mailmetrash.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |lovelydear@mailmetrash.com


--- Comment #5 from SomeDude <lovelydear@mailmetrash.com> 2012-04-28 02:58:17 PDT ---
No more ICE on 2.059 Win32

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------