Thread overview
[Issue 5925] New: Comparing associative array with a storage class (const/shared/immutable) causes segfault
May 03, 2011
kennytm@gmail.com
[Issue 5925] Comparing associative array with a type constructor (const/shared/immutable) causes segfault
Jun 01, 2011
kennytm@gmail.com
Jun 06, 2011
kennytm@gmail.com
May 03, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=5925

           Summary: Comparing associative array with a storage class
                    (const/shared/immutable) causes segfault
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: wrong-code
          Severity: normal
          Priority: P2
         Component: druntime
        AssignedTo: nobody@puremagic.com
        ReportedBy: kennytm@gmail.com


--- Comment #0 from kennytm@gmail.com 2011-05-03 12:12:32 PDT ---
Test case:

-----------------------
void main() {
    const a = [4:0];
    const b = [4:0];
    assert(a == b);
}
-----------------------

This causes a NULL-pointer exception in _aaEqual. The problem is _aaEqual's signature is

    int _aaEqual(TypeInfo_AssociativeArray ti, AA e1, AA e2)
  //             ^^^^^^^^^^^^^^^^^^^^^^^^^

but the typeid of a const AA is a TypeInfo_Const, so the 'ti.keys' used later is invalid.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
June 01, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=5925



--- Comment #1 from kennytm@gmail.com 2011-06-01 14:52:35 PDT ---
druntime pull #21.

https://github.com/D-Programming-Language/druntime/pull/21

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
June 06, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=5925


kennytm@gmail.com changed:

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


--- Comment #2 from kennytm@gmail.com 2011-06-06 12:32:23 PDT ---
https://github.com/D-Programming-Language/druntime/commit/b2bbaee6ffbc316b67278ce35bfa6ab73db17a7d

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