D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 20364 - [REG2.069] changing length for typeof(null)[] array seg faults in _d_arraysetlengthiT()
Summary: [REG2.069] changing length for typeof(null)[] array seg faults in _d_arrayset...
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: druntime (show other issues)
Version: D2
Hardware: All All
: P1 normal
Assignee: No Owner
URL:
Keywords: pull
Depends on:
Blocks:
 
Reported: 2019-11-06 17:35 UTC by Suleyman Sahmi (سليمان السهمي)
Modified: 2019-12-08 09:15 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 Suleyman Sahmi (سليمان السهمي) 2019-11-06 17:35:01 UTC
Test case:

```
void main()
{
    typeof(null)[] result;
    result.length = 1;
}
```
Comment 1 Walter Bright 2019-12-08 04:51:50 UTC
Is this really a regression? When did it ever work?
Comment 2 Walter Bright 2019-12-08 06:48:29 UTC
It's seg faulting in __memcpy()_sse2_unaligned called from _d_arraysetlengthiT().
Comment 3 Dlang Bot 2019-12-08 07:38:48 UTC
@WalterBright created dlang/druntime pull request #2860 "fix Issue 20364 - [REG2.069] changing length for typeof(null)[] array…" fixing this issue:

- fix Issue 20364 - [REG2.069] changing length for typeof(null)[] array seg faults in _d_arraysetlengthiT()

https://github.com/dlang/druntime/pull/2860
Comment 4 Dlang Bot 2019-12-08 09:15:12 UTC
dlang/druntime pull request #2860 "fix Issue 20364 - [REG2.069] changing length for typeof(null)[] array…" was merged into master:

- 8a7f4d4c9b3e4a4f796f6577591725f59c60eda7 by Walter Bright:
  fix Issue 20364 - [REG2.069] changing length for typeof(null)[] array seg faults in _d_arraysetlengthiT()

https://github.com/dlang/druntime/pull/2860