D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 20649 - Trait isZeroInit gives false in certain scenarios
Summary: Trait isZeroInit gives false in certain scenarios
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: druntime (show other issues)
Version: D2
Hardware: All All
: P1 regression
Assignee: No Owner
URL:
Keywords: ice, pull
Depends on:
Blocks:
 
Reported: 2020-03-09 09:03 UTC by godmyoh
Modified: 2020-03-21 03:56 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description godmyoh 2020-03-09 09:03:06 UTC
The following code causes `object.Error@(0): Access Violation` at `ss.length = 1` on Windows 64bit.

--- app.d
import std.traits;

struct S { int i; }

auto f()
{
    S[] ss;
    ss.length = 1;
}

alias a = ReturnType!f;

void main()
{
    f();
}
---

Tested on the following versions.

- dmd-2.090.0
- dmd-2.091.0-rc.1
Comment 1 basile-z 2020-03-09 09:24:42 UTC
according to run.dlang.io it's a regression in 2.087 or 2.087.1
Comment 2 basile-z 2020-03-09 09:25:54 UTC
sorry, the reg is from 2.088 and 2.087.1 is the last working.
Comment 3 Dlang Bot 2020-03-09 16:28:36 UTC
@BorisCarvajal created dlang/dmd pull request #10881 "Fix Issue 20649 - Trait isZeroInit gives false in certain scenarios" fixing this issue:

- Fix Issue 20649 - Trait isZeroInit gives false in certain scenarios

https://github.com/dlang/dmd/pull/10881
Comment 4 Dlang Bot 2020-03-10 00:13:49 UTC
dlang/dmd pull request #10881 "Fix Issue 20649 - Trait isZeroInit gives false in certain scenarios" was merged into stable:

- 7ed52727aa50a021795abc06f91592b0adcc9b13 by Boris Carvajal:
  Fix Issue 20649 - Trait isZeroInit gives false in certain scenarios

https://github.com/dlang/dmd/pull/10881