Bug 18800 – [REG2.080.0-beta.1] Array.length setter segfaults for payloads with indirections

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2018-04-26T12:07:58Z
Last change time
2018-05-02T00:49:29Z
Keywords
pull
Assigned to
No Owner
Creator
Sönke Ludwig

Comments

Comment #0 by sludwig — 2018-04-26T12:07:58Z
--- import std.container.array; struct S { void* p; } void main() { Array!S a; a.length = 10; // segfault } --- The code uses `_payload.sizeof` instead of `_payload.length*T.sizeof`
Comment #1 by code — 2018-04-30T09:12:35Z
Comment #2 by github-bugzilla — 2018-05-02T00:49:28Z
Commits pushed to master at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/b2016be15501039956e370ddc94e623a1caee0c5 fix Issue 18800 - Array.length setter segfaults for payloads with indirections https://github.com/dlang/phobos/commit/56e9396786140bec6b969c6d5d63d1ed36054e59 Merge pull request #6486 from MartinNowak/fix18800 fix Issue 18800 - Array.length setter segfaults for payloads with indirections