www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 7704] New: RangeError when using key optainey by AA byKey() iteration

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

           Summary: RangeError when using key optainey by AA byKey()
                    iteration
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: druntime
        AssignedTo: nobody puremagic.com
        ReportedBy: tobias pankrath.net



PDT ---
I get this error:


tobias akela-buntschuh:~/projects/neo$ ./test 
core.exception.RangeError test(18): Range violation
----------------
./test(_d_array_bounds+0x2a) [0x447c82]
./test() [0x4440c6]
./test(void test.main().int __foreachbody1285(ref immutable(dchar)[])+0x5c)
[0x4435a8]
./test(int delegate(int delegate(ref immutable(dchar)[]))
object.AssociativeArray!(immutable(dchar)[], int).AssociativeArray.byKey().int
foo(int delegate(ref immutable(dchar)[])).int byKeydg(ref immutable(dchar)[],
ref int)+0x24) [0x443894]
./test(_aaApply2+0x74) [0x4471e4]
./test(int delegate(int delegate(ref immutable(dchar)[]))
object.AssociativeArray!(immutable(dchar)[], int).AssociativeArray.byKey().int
foo(int delegate(ref immutable(dchar)[]))+0x54) [0x443868]
./test(_Dmain+0x3c) [0x443540]
./test(extern (C) int rt.dmain2.main(int, char**).void runMain()+0x17)
[0x448227]
./test(extern (C) int rt.dmain2.main(int, char**).void tryExec(scope void
delegate())+0x2a) [0x447dce]
./test(extern (C) int rt.dmain2.main(int, char**).void runAll()+0x42)
[0x44827a]
./test(extern (C) int rt.dmain2.main(int, char**).void tryExec(scope void
delegate())+0x2a) [0x447dce]
./test(main+0xd3) [0x447d5f]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xed) [0x7fa6018ca30d]

when running the attached program with DMD 2.57

int[dstring] aa;

static this()
{
    aa = [
        "+"d : 1,
        "/"d : 2,
        "-"d : 3,
        "*"d : 4
    ];
}

void main()
{
    foreach(key; aa.byKey())
        writeln(aa[key]);
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Mar 13 2012
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7704


hsteoh quickfur.ath.cx changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |hsteoh quickfur.ath.cx



This appears to be the same as bug 7512, which has been fixed in git.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Mar 13 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7704




Now that 2.059 is out, could you re-test this bug to see if it has been fixed?
I believe what you're seeing is the same as bug 7512, which has been fixed.
Thanks!

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Apr 17 2012
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7704


Tobias Pankrath <tobias pankrath.net> changed:

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



PDT ---
It's fixed.

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