www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 3196] New: Bad struct declaration before a anonymous delegate within the parameter list show a segment fault

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

           Summary: Bad struct declaration before a anonymous delegate
                    within the parameter list show a segment fault
           Product: D
           Version: 2.031
          Platform: x86
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: lifc0 yahoo.com.cn


Try this on both linux and windows with dmd 2.031 give me a segment fault
because of a null pointer reference.

struct Foo {
}

void foo (Foo b, void delegate ()) {
}

void main () {
    foo(Foo(1), (){});
}

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


Don <clugdbug yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |clugdbug yahoo.com.au
            Summary|Bad struct declaration      |Segfault(mtype.c) Bad
                   |before a anonymous delegate |struct declaration before a
                   |within the parameter list   |anonymous delegate within
                   |show a segment fault        |the parameter list




--- Comment #1 from Don <clugdbug yahoo.com.au>  2009-08-05 01:01:53 PDT ---
Bug #3227 and bug #3228 are probably duplicates of this one.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Aug 05 2009
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3196


Don <clugdbug yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|Segfault(mtype.c) Bad       |Segfault(mtype.c) almost
                   |struct declaration before a |any error involving a
                   |anonymous delegate within   |delegate inside a function
                   |the parameter list          |
           Severity|normal                      |regression




--- Comment #2 from Don <clugdbug yahoo.com.au>  2009-08-06 00:00:22 PDT ---
Original title:
"Bad struct declaration before a anonymous delegate within the parameter list
show a segment fault" It's actually a lot more general than that. And it's a
regression.

Another example from bug #3227:

auto x = (void){};
----
ice.d(1): Error: cannot have parameter of type void
ice.d(1): Error: cannot have parameter of type void
<segfault>

Other examples from bug #3228:

void main(){ (){}; (){}; }

ice.d(1): Error: function has no effect in expression (__dgliteral1)
<segfault>

This smiley variant should compile without errors. But it just segfaults.
---
static assert(!is(typeof((){(){}
         ;-()
{};})));

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Aug 06 2009
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3196





--- Comment #3 from Don <clugdbug yahoo.com.au>  2009-08-06 00:00:57 PDT ---
*** Issue 3227 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: -------
Aug 06 2009
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3196





--- Comment #4 from Don <clugdbug yahoo.com.au>  2009-08-06 00:01:17 PDT ---
*** Issue 3228 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: -------
Aug 06 2009
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3196


Walter Bright <bugzilla digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |bugzilla digitalmars.com
         Resolution|                            |FIXED




--- Comment #5 from Walter Bright <bugzilla digitalmars.com>  2009-09-03
13:27:18 PDT ---
Fixed dmd 1.047 and 2.032

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