www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 3337] New: weird behavior of associative arrays

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

           Summary: weird behavior of associative arrays
           Product: D
           Version: 2.032
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: rinick gmail.com



int[int[]] t;
t[[1]] = 1;
writeln(t);

output:
[[1245088]:1]

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


David Simcha <dsimcha yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dsimcha yahoo.com



Probably uninitialized memory or something.  I'm also using 2.032, and using
the following code:

import std.stdio;

void main() {
    int[int[]] t;
    t[[1]] = 1;
    writeln(t);
}


I get:

[[14]:1]

The point isn't the specific number, but the fact that the number is
non-deterministic.

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




Oh yeah, also notable is that this isn't just a bug in converting to string. 
The following code produces an access violation:

import std.stdio;

void main() {
    int[int[]] t;
    t[[1]] = 1;
    writeln(t[[1]]);
}

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


ZY Zhou <rinick gmail.com> changed:

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



Seems this bug has already been fixed

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