www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 9248] New: [2.061 beta] Concatenation of array literal and array produces corrupted result

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

           Summary: [2.061 beta] Concatenation of array literal and array
                    produces corrupted result
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Severity: regression
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: sludwig outerproduct.org


--- Comment #0 from Sönke Ludwig <sludwig outerproduct.org> 2013-01-01 08:03:52
PST ---
The following code produces something similar to:

in: 1 [2]
out: [1, 1C11FE0]

instead of:

in: 1 [2]
out: [1, 2]

---
import std.stdio;

void test2(void*[] arr){
    writefln("out: %s", arr);
}

void test(void* a, void*[] arr){
    writefln("in: %s %s", a, arr);
    test2([a] ~ arr);
}

void main(){
    void*[] arr;
    arr ~= cast(void*)2;
    test(cast(void*)1, arr);
}
---

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 01 2013
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9248


Sönke Ludwig <sludwig outerproduct.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |wrong-code


--- Comment #1 from Sönke Ludwig <sludwig outerproduct.org> 2013-01-01 08:14:47
PST ---
Simplified test case:

void main()
{
    void*[] a = [cast(void*)1];
    void*[] b = [cast(void*)2];
    auto c = a ~ b;
    assert(c == [cast(void*)1, cast(void*)2]);
}

Corruption does not occur for integral element types.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 01 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9248



--- Comment #2 from github-bugzilla puremagic.com 2013-01-01 10:42:51 PST ---
Commit pushed to staging at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/5b8d3b7e6537601f2f914d1109d85e8686f02098
fix Issue 9248 - [2.061 beta] Concatenation of array literal and array produces
corrupted result

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 01 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9248


Walter Bright <bugzilla digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |bugzilla digitalmars.com
           Platform|x86                         |All
         Resolution|                            |FIXED
         OS/Version|Windows                     |All


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 01 2013
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9248



--- Comment #3 from github-bugzilla puremagic.com 2013-01-02 12:23:34 PST ---
Commit pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/017af09a5ff1320f1770f3ad868a9170e6960b7b
fix issue 9248

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