September 07, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=6178



--- Comment #20 from Kenji Hara <k.hara.pg@gmail.com> 2013-09-07 10:37:10 PDT ---
(In reply to comment #4)
> With an opAssign, an assignment to an AA struct will become something like
> 
>     Bug __aatmp1234 = void;   // <---
>     __aatmp1234.opAssign(1);
>     map.set(0, __aatmp1234);
>     map[0].___postblit();
> 
> the '3' is likely due to the '<---' line. See bug 2451.

This is the root cause. If the value struct in AA has opAssign method, it would be called on uninitialized object.

For such structs, AA value setting should do additional work to distinguish initializing and assignment.

struct S1 {
    void opAssign(S1 rhs) {}
}

S1[int] aa1;
aa1[1] = S1();  // [*]

I think the line at [*] should behave as follows:
1. If the key doesn't exist in aa yet, so it should work as initializing.
2. If the key already exists in aa, so it should work as assignment
   (== opAssign call).

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
September 08, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=6178


Kenji Hara <k.hara.pg@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull, wrong-code
           Platform|x86                         |All
         OS/Version|Linux                       |All


--- Comment #21 from Kenji Hara <k.hara.pg@gmail.com> 2013-09-08 03:28:06 PDT ---
(In reply to comment #20)
> For such structs, AA value setting should do additional work to distinguish initializing and assignment.
> 
> struct S1 {
>     void opAssign(S1 rhs) {}
> }
> 
> S1[int] aa1;
> aa1[1] = S1();  // [*]
> 
> I think the line at [*] should behave as follows:
> 1. If the key doesn't exist in aa yet, so it should work as initializing.
> 2. If the key already exists in aa, so it should work as assignment
>    (== opAssign call).

https://github.com/D-Programming-Language/dmd/pull/2539 https://github.com/D-Programming-Language/phobos/pull/1554

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
September 14, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=6178



--- Comment #22 from github-bugzilla@puremagic.com 2013-09-14 13:52:10 PDT ---
Commits pushed to master at https://github.com/D-Programming-Language/phobos

https://github.com/D-Programming-Language/phobos/commit/e36292ebe5f9569de0956f261ceb2eed7123271c Supplement fix fox issue 6178

AA value setting through alias this should not be allowed, because it could access invalid object state.

https://github.com/D-Programming-Language/phobos/commit/4721a44fb30632e81c430e886851d833f0a43ba4 Merge pull request #1554 from 9rnsr/fix6178

Supplement fix fox issue 6178

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
September 22, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=6178



--- Comment #23 from Kenji Hara <k.hara.pg@gmail.com> 2013-09-22 10:47:51 PDT ---
*** Issue 5822 has been marked as a duplicate of this issue. ***

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
September 22, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=6178


Kenji Hara <k.hara.pg@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |juhonurm@gmail.com


--- Comment #24 from Kenji Hara <k.hara.pg@gmail.com> 2013-09-22 10:51:54 PDT ---
*** Issue 8170 has been marked as a duplicate of this issue. ***

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
September 22, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=6178



--- Comment #25 from github-bugzilla@puremagic.com 2013-09-22 13:04:22 PDT ---
Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/1f5be26103a644b2650ae2d811edbc04c18236b7 fix Issue 6178 - Struct inside the AA are not init correctly

If the AA value setting invokes opAsign method, it would need additional runtime const to distinguish construction and assignment.

https://github.com/D-Programming-Language/dmd/commit/26ca8f7c83808a2dd2c1f4e2a80a08ec567cac34 Merge pull request #2539 from 9rnsr/fix6178

Issue 6178 - Struct inside the AA are not init correctly

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
September 22, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=6178


Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |bugzilla@digitalmars.com
         Resolution|                            |FIXED


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
September 27, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=6178



--- Comment #26 from github-bugzilla@puremagic.com 2013-09-27 02:05:01 PDT ---
Commit pushed to master at https://github.com/D-Programming-Language/dlang.org

https://github.com/D-Programming-Language/dlang.org/commit/ebcc484ea5be319beb61aceaf4ec30a0dff0f4f5 fix Issue 6178 - Struct inside the AA are not init correctly

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
1 2 3
Next ›   Last »