[Issue 9352] Memory corruption in delegate called by struct dtor

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Jan 18 12:15:11 PST 2013


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


Adam D. Ruppe <destructionator at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |destructionator at gmail.com


--- Comment #1 from Adam D. Ruppe <destructionator at gmail.com> 2013-01-18 12:15:10 PST ---
I think what's happening here is the delegate stores a pointed to the struct
made in the ctor, which is on the stack. It gets moved when it returns from the
function, but the delegate still points at the old memory, which gets
overwritten by whatever.

I figure the best fix would be for the struct copy to update the delegate
pointer (if I'm right about what's going on).

OR, we could ban it, since that is a (hidden) internal pointer which i think is
banned by the D spec.. probably for exactly this reason.

-- 
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