www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 3304] New: Segfault using 'is' with a pointer enum.

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

           Summary: Segfault using 'is' with a pointer enum.
           Product: D
           Version: 2.022
          Platform: Other
        OS/Version: All
            Status: NEW
          Severity: major
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: clugdbug yahoo.com.au


--- Comment #0 from Don <clugdbug yahoo.com.au> 2009-09-07 07:47:24 PDT ---
This is the first bug from bug 3293.
Test case:
---
enum bug3303 = cast(void*)0xFEFEFEFE;
static assert(bug3303 is bug3303);
---
Crashes because e->optimize() is returning NULL. Bug has existed in at least
2.022 to 2.032.

-- 
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=3304


Don <clugdbug yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|ice-on-valid-code           |ice-on-invalid-code, patch


--- Comment #1 from Don <clugdbug yahoo.com.au> 2009-09-07 08:00:17 PDT ---
Root cause: IndentityExp didn't consider the possibility that Equals() can
return CANTINTERPRET.

patch: In optimize.c, IdentityExp::optimize, line 838 (DMD2.032)

    if ((this->e1->isConst()     && this->e2->isConst()) ||
    (this->e1->op == TOKnull && this->e2->op == TOKnull))
    {
    e = Identity(op, type, this->e1, this->e2);
+    if (e == EXP_CANT_INTERPRET)
+        e = this;
    }
    return e;

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


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:17:43 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