[Issue 6178] Struct inside the AA are not init correctly

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Jan 15 14:19:44 PST 2013


http://d.puremagic.com/issues/show_bug.cgi?id=6178


Dmitry Olshansky <dmitry.olsh at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dmitry.olsh at gmail.com


--- Comment #12 from Dmitry Olshansky <dmitry.olsh at gmail.com> 2013-01-15 14:19:41 PST ---
I've just hit another case of this bug on Win32. 

It's a major impediment for new std.uni as it may result in memery corruption 
if a set of code points is written to AA like this:

//this one calls destructor twice and no postblit and causes memory corruption
props["Set"] = CodepointSet(a1, a2+1);

//While this one is fine (it calls postblit):
auto set = CodepointSet(a1, a2+1);
props["Set"] = set;

There is no opAssign only postblit + destructor.

The problem is that in the real world the destructor is tricky and
expects at least T.init or some valid object else it blows up quite nasty.

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


More information about the Digitalmars-d-bugs mailing list