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

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Jan 18 12:25:34 PST 2013


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



--- Comment #3 from hsteoh at quickfur.ath.cx 2013-01-18 12:25:33 PST ---
Rather than banning this outright, I think a better approach may be to detect
when a delegate is referencing the struct on the stack, and create the struct
on the heap instead. Sorta like how local variables will be allocated on the
heap instead of the stack if the function returns a delegate that references
them.

(But I'm not sure how feasible it is to do this in a struct ctor, though!)

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