Bug 11311 – [REG 2.064] Destructor not called on temporary with opIndex + opSlice

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-10-21T03:02:00Z
Last change time
2013-10-22T14:26:58Z
Keywords
pull, wrong-code
Assigned to
nobody
Creator
code

Attachments

IDFilenameSummaryContent-TypeSize
1272repro.drepro casetext/x-dsrc1127

Comments

Comment #0 by code — 2013-10-21T03:02:07Z
Created attachment 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.
Comment #1 by k.hara.pg — 2013-10-22T01:03:01Z
Comment #2 by github-bugzilla — 2013-10-22T13:52:54Z
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
Comment #3 by github-bugzilla — 2013-10-22T13:53:57Z
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