D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 16102 - [REG2.070] struct dtor replace value on stack
Summary: [REG2.070] struct dtor replace value on stack
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86_64 Linux
: P1 regression
Assignee: No Owner
URL:
Keywords: wrong-code
Depends on:
Blocks:
 
Reported: 2016-05-30 19:21 UTC by Oleg B
Modified: 2017-01-16 23:25 UTC (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Oleg B 2016-05-30 19:21:19 UTC
struct A { ~this() { } }

long[1] foo()
{
    A a;
    return [1];
}

void main()
{
    assert( foo() == [1] );
}

work for all static arrays with size == 8 bytes (int[2], float[2], ubyte[8], etc)
only on debug mode assert fails

dmd --version
DMD64 D Compiler v2.071.0
Copyright (c) 1999-2015 by Digital Mars written by Walter Bright
Comment 1 ag0aep6g 2016-05-30 19:40:47 UTC
Assert does not fail with dmd 2.069 or earlier. Marking as regression.
Comment 2 hsteoh 2016-11-17 19:38:37 UTC
May be related to https://issues.dlang.org/show_bug.cgi?id=16699
Comment 3 Dicebot 2016-11-20 00:39:23 UTC
https://github.com/dlang/dmd/pull/6263
Comment 4 github-bugzilla 2016-11-20 01:26:18 UTC
Commits pushed to stable at https://github.com/dlang/dmd

https://github.com/dlang/dmd/commit/6bff4520cc77b682948db87026bfcea1cf150cb2
add test case for issue 16102

fixes issue 16102

https://github.com/dlang/dmd/commit/fd9eed45d0ce5c1e86a2e0f6c4148f982d66aa9c
Merge pull request #6263 from aG0aep6G/16102

Fix issue 16102 - [REG2.070] struct dtor replace value on stack
Comment 5 github-bugzilla 2016-12-18 22:53:14 UTC
Commits pushed to master at https://github.com/dlang/dmd

https://github.com/dlang/dmd/commit/6bff4520cc77b682948db87026bfcea1cf150cb2
add test case for issue 16102

https://github.com/dlang/dmd/commit/fd9eed45d0ce5c1e86a2e0f6c4148f982d66aa9c
Merge pull request #6263 from aG0aep6G/16102
Comment 6 github-bugzilla 2016-12-27 14:41:11 UTC
Commits pushed to scope at https://github.com/dlang/dmd

https://github.com/dlang/dmd/commit/6bff4520cc77b682948db87026bfcea1cf150cb2
add test case for issue 16102

https://github.com/dlang/dmd/commit/fd9eed45d0ce5c1e86a2e0f6c4148f982d66aa9c
Merge pull request #6263 from aG0aep6G/16102
Comment 7 github-bugzilla 2017-01-16 23:25:04 UTC
Commits pushed to newCTFE at https://github.com/dlang/dmd

https://github.com/dlang/dmd/commit/6bff4520cc77b682948db87026bfcea1cf150cb2
add test case for issue 16102

https://github.com/dlang/dmd/commit/fd9eed45d0ce5c1e86a2e0f6c4148f982d66aa9c
Merge pull request #6263 from aG0aep6G/16102