www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 8179] New: [ICE] with failed opCall

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8179

           Summary: [ICE] with failed opCall
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: bearophile_hugs eml.cc



struct Foo {
    static void opCall(int[2][1]) {}
}
void main() {
    Foo(cast(int[2][1])[1, 2]);
}


DMD 2.060alpha gives:

test.d(5): Error: e2ir: cannot cast [1,2] of type int[] to type int[2u][1u]
Internal error: e2ir.c 155

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jun 01 2012
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8179


bearophile_hugs eml.cc changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[ICE] with failed opCall    |[ICE] with failed fixed
                   |                            |size array cast



A simpler test case shows it's not related to opCall, so I have updated the
title:


void foo(int[2][1]) {}
void main() {
    foo(cast(int[2][1])[1, 2]);
}

----------------------------

A similar but not equal case (arrays are 1D):

void foo(int[2] data) {}
void main() {
    int[4] data;
    int[2] data2 = data[0 .. 2]; // OK
    foo(data2); // OK
    foo(cast(int[2])data[0 .. 2]); // Internal error
}


test.d(6): Error: e2ir: cannot cast data[0u..2u] of type int[] to type int[2u]
Internal error: e2ir.c 189

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 18 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8179


Martin Krejcirik <mk krej.cz> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mk krej.cz
         OS/Version|Windows                     |All



I get segfault on this (D2 only, 2.062, Linux/Windows):

void main()
{
    int[2] a;
    a = cast(int[2])null;
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Apr 02 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8179


Walter Bright <bugzilla digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bugzilla digitalmars.com



23:14:46 PDT ---

 I get segfault on this (D2 only, 2.062, Linux/Windows):
 
 void main()
 {
     int[2] a;
     a = cast(int[2])null;
 }
Fix for this only: https://github.com/D-Programming-Language/dmd/pull/2638 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Oct 06 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8179




Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/9a8ca60f58d08926b1c623ab298371b064a7e60d
fix Issue 8179 - ICE(e2ir.c) with failed fixed size array cast

https://github.com/D-Programming-Language/dmd/commit/04dfab6cdd1c7e5bc6f512db058575faf4257226


fix Issue 8179 - ICE(e2ir.c) with failed fixed size array cast

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 08 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8179


Walter Bright <bugzilla digitalmars.com> changed:

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


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 08 2013
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8179


Martin Krejcirik <mk krej.cz> changed:

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



Reopening, since the code from original description and comment 1 were not
fixed (comment 1 part 2 does work though).

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