Thread overview
[Issue 6118] New: nested overloaded foreach in contract crashes dmd
Jun 07, 2011
Mike Shulman
Apr 24, 2012
SomeDude
Mar 04, 2013
Maksim Zholudev
June 07, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=6118

           Summary: nested overloaded foreach in contract crashes dmd
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody@puremagic.com
        ReportedBy: viritrilbia+d@gmail.com


--- Comment #0 from Mike Shulman <viritrilbia+d@gmail.com> 2011-06-06 17:34:52 PDT ---
The following code crashes DMD v2.053 with "Internal error: ../ztc/cgcs.c 363":


class foo {
  int opApply(int delegate(ref int) dg) const { return 0; }

  foo bar()
    out(result) {
      foreach (x ; result)
        foreach (y ; result)
          assert(x);
    }
  body { return this; }
}


I haven't been able to simplify the code any further and still reproduce the crash.  Removing the second foreach makes it compile, as does replacing "assert(x)" with anything not referring to "x".

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


SomeDude <lovelydear@mailmetrash.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |lovelydear@mailmetrash.com
           Platform|Other                       |All
         OS/Version|Linux                       |All


--- Comment #1 from SomeDude <lovelydear@mailmetrash.com> 2012-04-24 01:06:02 PDT ---
Also crashes on 2.059 Win32.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
March 04, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=6118


Maksim Zholudev <maximzms@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |maximzms@gmail.com


--- Comment #2 from Maksim Zholudev <maximzms@gmail.com> 2013-03-04 09:24:04 PST ---
Linux, 64-bit
DMD Git head:
https://github.com/D-Programming-Language/dmd/commit/13b3bdbf3819fec810ebfb077957510612dfa815

--------------------
Internal error: backend/cgcs.c 343
--------------------

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