← Back to index
|
Original Bugzilla link
Bug 14585 – destructor called on garbage in std.variant
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2015-05-15T11:41:00Z
Last change time
2017-07-19T17:43:21Z
Assigned to
nobody
Creator
ag0aep6g
Comments
Comment #0
by ag0aep6g — 2015-05-15T11:41:34Z
Originally found by Fyodor Ustinov who posted to digitalmars.D.learn and digitalmars.D:
http://forum.dlang.org/post/
[email protected]
http://forum.dlang.org/post/
[email protected]
Pull request on the way. ---- import std.stdio; import std.variant: Variant; struct S { int x = 42; ~this() { writeln("x: ", x); assert(x == 42); } } void main() { Variant(S()).get!S; } ---- Output (truncated): ---- x: 42 x: 42 x: 42 x: 7017840 x: 42
[email protected]
(10): Assertion failure ----
Comment #1
by github-bugzilla — 2015-05-17T01:22:10Z
Commits pushed to master at
https://github.com/D-Programming-Language/phobos
https://github.com/D-Programming-Language/phobos/commit/15712f6e6ccc68f86142d75d5f659ca746e8fabe
fix issue 14585 - destructor called on garbage in std.variant
https://github.com/D-Programming-Language/phobos/commit/4e0347a59c0260f78d1c1ea4ee1a81bc89c93570
Merge pull request #3284 from aG0aep6G/variant fix std.variant issues 14585 and 14586
Comment #2
by github-bugzilla — 2017-07-19T17:43:21Z
Commits pushed to dmd-cxx at
https://github.com/dlang/phobos
https://github.com/dlang/phobos/commit/15712f6e6ccc68f86142d75d5f659ca746e8fabe
fix issue 14585 - destructor called on garbage in std.variant
https://github.com/dlang/phobos/commit/4e0347a59c0260f78d1c1ea4ee1a81bc89c93570
Merge pull request #3284 from aG0aep6G/variant