Thread overview
[Issue 5737] New: postblit not called for locals initialized from ref functions
Mar 15, 2011
Max Samukha
Mar 18, 2012
Ferdinand Majerech
May 05, 2012
Kenji Hara
May 05, 2012
Kenji Hara
May 08, 2012
Walter Bright
March 15, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=5737

           Summary: postblit not called for locals initialized from ref
                    functions
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: critical
          Priority: P2
         Component: DMD
        AssignedTo: nobody@puremagic.com
        ReportedBy: samukha@voliacable.com


--- Comment #0 from Max Samukha <samukha@voliacable.com> 2011-03-15 01:54:18 PDT ---
struct S
{
    static int destroyed;
    static int copied;

    this(this)
    {
        copied++;
    }

    ~this()
    {
        destroyed++;
    }
}

S s;

ref S foo()
{
    return s;
}

void main()
{
    {
        auto s2 = foo();
    }

    assert(S.copied == 1); // fail, s2 was not copied;
    assert(S.destroyed == 1); // ok, s2 was destroyed
}

The destructor is called on s2, though s2 has not been postblit(ted?). Maybe the same as other struct lifetime bugs.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
March 18, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=5737


Ferdinand Majerech <kiithsacmp@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kiithsacmp@gmail.com


--- Comment #1 from Ferdinand Majerech <kiithsacmp@gmail.com> 2012-03-18 02:45:08 PDT ---
Confirmed to still happen with DMD 2.058 .

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 05, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=5737


Kenji Hara <k.hara.pg@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |k.hara.pg@gmail.com


--- Comment #2 from Kenji Hara <k.hara.pg@gmail.com> 2012-05-04 23:30:37 PDT ---
*** Issue 8045 has been marked as a duplicate of this issue. ***

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 05, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=5737


Kenji Hara <k.hara.pg@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull, wrong-code
           Platform|Other                       |All
         OS/Version|Linux                       |All


--- Comment #3 from Kenji Hara <k.hara.pg@gmail.com> 2012-05-04 23:31:21 PDT ---
https://github.com/D-Programming-Language/dmd/pull/927

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 08, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=5737



--- Comment #4 from github-bugzilla@puremagic.com 2012-05-07 18:10:45 PDT ---
Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/70cbf1b9fb947a7abe920836e0b5746a39254ac0 fix Issue 5737 - postblit not called for locals initialized from ref functions

https://github.com/D-Programming-Language/dmd/commit/7f18602f38082d8b837112fed1d5d10b222e3b87 Merge pull request #927 from 9rnsr/fix_postblit

Issue 5737 & 6199 - fix postblit call with ref return

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 08, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=5737


Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |bugzilla@digitalmars.com
         Resolution|                            |FIXED


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