www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 5754] New: 'glue.c' assertion failure with map(filter)

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

           Summary: 'glue.c' assertion failure with map(filter)
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: bearophile_hugs eml.cc



import std.algorithm;
void main() {
    int[] a = [1];
    map!((int i){ return filter!((int j){ return i; })(a); })(a);
}


With DMD 2.052 gives:
Assertion failure: '!vthis->csym' on line 703 in file 'glue.c'


Equivalent Python 2.6 code:

 a = [1]
 map(lambda i: filter(lambda j: i, a), a)
[[1]] -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Mar 19 2011
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5754


kennytm gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kennytm gmail.com



Any chance it is the same as issue 4129?

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


kennytm gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         OS/Version|Windows                     |All



Reduced test case (I think):

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


void x(alias pred)() {
    pred();
}

void main() {
    x!((){
        int i;  // declare in outer scope
        x!((){
            cast(void) i;   // access in inner scope
        });
    });
}

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


Don <clugdbug yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|ICE('glue.c'): using nested |ICE(glue.c): using nested
                   |delegate literal as         |delegate literal as
                   |template alias parameter    |template alias parameter



See also bug 2962.

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


SomeDude <lovelydear mailmetrash.com> changed:

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



PDT ---
Compiles and runs with 2.059 Win32

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




PDT ---
I don't have the D1 compiler installed but it would be worth trying if issue
2962 is resolved as well.

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


bearophile_hugs eml.cc changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |regression




 Compiles and runs with 2.059 Win32
Yes, both cases now compile. But I have found a way to trigger the same error. First module, named "module1.d": import std.stdio; import module2; void main() {} Second module, named "module2.d": import std.algorithm: reduce; struct Foo { string bar() { auto spam = (string s, int) => ""; return reduce!spam("", [1]); } } It generates, dmd 2.061alpha: Assertion failure: '!vthis->csym' on line 787 in file 'glue.c' Since you say this used to work before, it's now a regression. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Dec 14 2012
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5754


bearophile_hugs eml.cc changed:

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



Sorry, I guess it's a different bug, so I close this down and open another one.
So ignore comment 6 please.

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