www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 11311] New: [REG 2.064] Destructor not called on temporary with opIndex + opSlice

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=11311

           Summary: [REG 2.064] Destructor not called on temporary with
                    opIndex + opSlice
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: regression
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: code benjamin-thaut.de


--- Comment #0 from Benjamin Thaut <code benjamin-thaut.de> 2013-10-21 03:02:07
PDT ---
Created an attachment (id=1272)
repro case

The attached repro case will print:

452fc0 => 1
452fc0 => 2
453fc0 => 1
452fc0 => 1
before bar
453fc0 => 2
453fc0 => 1
after bar
453fc0 => 0

on dmd 2.063 and before. On dmd 2.064 (latest git head) it will print:

1c02fc0 => 1
1c02fc0 => 2
1c03fc0 => 1
1c02fc0 => 1
before bar
1c03fc0 => 2
after bar
1c03fc0 => 1

This causes numerous memory leaks when using ref-counting for memory
management. It seems that the temproary object which is returned from getObj()
will never be destructed.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 21 2013
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=11311


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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull, wrong-code


--- Comment #1 from Kenji Hara <k.hara.pg gmail.com> 2013-10-22 01:03:01 PDT ---
https://github.com/D-Programming-Language/dmd/pull/2688

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 22 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=11311



--- Comment #2 from github-bugzilla puremagic.com 2013-10-22 13:52:54 PDT ---
Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/88d22eeb8e808fa8679a4bf495a45ed9f7bef847
fix Issue 11311 - Destructor not called on temporary with opIndex + opSlice

https://github.com/D-Programming-Language/dmd/commit/e7e2d5fa43b3a43d0d599566450508830dc753f0
Merge pull request #2688 from 9rnsr/fix11311

[REG2.064a] Issue 11311 - Destructor not called on temporary with opIndex +
opSlice

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 22 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=11311



--- Comment #3 from github-bugzilla puremagic.com 2013-10-22 13:53:57 PDT ---
Commit pushed to 2.064 at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/8b01280588cd742b9a66c1d3eb40ba640f11c1b8
Merge pull request #2688 from 9rnsr/fix11311

[REG2.064a] Issue 11311 - Destructor not called on temporary with opIndex +
opSlice

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 22 2013
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=11311


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: -------
Oct 22 2013