[Issue 12226] New: functions can return local stack-allocated objects by reference

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Feb 22 12:25:46 PST 2014


https://d.puremagic.com/issues/show_bug.cgi?id=12226

           Summary: functions can return local stack-allocated objects by
                    reference
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: accepts-invalid, diagnostic
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: andrea.9940 at gmail.com


--- Comment #0 from andrea.9940 at gmail.com 2014-02-22 12:25:43 PST ---
An auto ref function can return a local stack-allocated struct by reference
causing undefined behavior when executed.

Sample code: http://pastebin.com/rvcNdjAE

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


More information about the Digitalmars-d-bugs mailing list