www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 5453] New: ICE(statement.c): array literal involving forward referenced struct

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

           Summary: ICE(statement.c): array literal involving forward
                    referenced struct
           Product: D
           Version: D1 & D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: clugdbug yahoo.com.au



Reported by %u.
------------
struct S
{    
  static int func() {
    S s;
    int e;
    switch( e )
    {  default: return 0;
    }
  }    
  static int[1] ARR = [func() ];
}
----
Assertion failure: '!cases' on line 2741 in file 'statement.c'

abnormal program termination


It's happening because the CTFE for ARR speculatively runs func().
There's a 'no size yet for forward referenced struct' error because S isn't
complete yet. But this happens with errors gagged.
The SwitchStatement completes its semantic pass correctly. 
But, because "S s;" failed, semantic gets run again for func(), without errors
gagged this time. SwitchStatement::semantic() detects it's been run twice, and
asserts.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 14 2011
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5453


Don <clugdbug yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |timon.gehr gmx.ch



*** Issue 6326 has been marked as a duplicate of this issue. ***

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jul 26 2011
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5453


Walter Bright <bugzilla digitalmars.com> changed:

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



00:45:54 PDT ---
D2 fix:
https://github.com/D-Programming-Language/dmd/commit/0a927f258e89f92f280c0e855a93ceb05e34a260

Partial D1 fix:
https://github.com/D-Programming-Language/dmd/commit/31d6751de3a877c72055a2096a9a9c4a9a25ec9b

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Sep 14 2011
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5453


Walter Bright <bugzilla digitalmars.com> changed:

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



11:23:45 PDT ---
D1 fix:
https://github.com/D-Programming-Language/dmd/commit/23846aca52ebd21efab36ff32924c5a6cc17c4c0

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