[Issue 10829] New: -inline produces wrong code

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Aug 15 13:34:13 PDT 2013


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

           Summary: -inline produces wrong code
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: major
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: temtaime at gmail.com


--- Comment #0 from Temtaime <temtaime at gmail.com> 2013-08-15 13:34:12 PDT ---
I have a big project, so i cannot figure test-case now. I'll investigate in it
a little later. Minimized piece of code that demonstrates the problem.


    static void bringToTop(GUIElement[] arr) {
        if(arr.length < 2)
            return;

        auto p = arr[0];
        auto c = arr[1];

        writefln(`c == %s`, cast(int)cast(void *)c);

        p._childs = c ~ p._childs.filter!(a => (writefln(`in lambda c == %s`,
cast(int)cast(void *)c), a != c)).array;
    }

GUIElement is a class. GUIElement._childs is an array of GUIElement.

Output with -inline:
c == 7982336
in lambda c == 0

Optput without -inline:
c == 3751104
in lambda c == 3751104

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