www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 3305] New: Segfault(expression.c) with recursive struct template alias expressions

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

           Summary: Segfault(expression.c) with recursive struct template
                    alias expressions
           Product: D
           Version: 2.022
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: clugdbug yahoo.com.au


--- Comment #0 from Don <clugdbug yahoo.com.au> 2009-09-07 08:26:42 PDT ---
This is the third bug in bug 3293. Hard to explain, but here is the test case:
----
struct bug3305(alias X = 0) {
    auto guard = bug3305b!(0).guard;
}

struct bug3305b(alias X = 0){
    bug3305!(X) goo; 
    auto guard = 0;
}

void test(){
    bug3305!(0) a;
}

---
Segfaulting in expression.c, Expression::deref(), with a NULL type.

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


Don <clugdbug yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch


--- Comment #1 from Don <clugdbug yahoo.com.au> 2009-09-25 06:52:20 PDT ---
This is trivial. expression.c, line 1246. It's already an error, we just need
to prevent it from crashing.

Expression *Expression::deref()
{
    //printf("Expression::deref()\n");
-    if (type->ty == Treference)
+    if (type && type->ty == Treference)
    {    Expression *e;

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


Walter Bright <bugzilla digitalmars.com> changed:

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


--- Comment #2 from Walter Bright <bugzilla digitalmars.com> 2009-10-06
02:18:14 PDT ---
Fixed dmd 1.048 and 2.033

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