Bug 23097 – [REG 2.100] ArrayIndexError@src/dmd/mtype.d(4767): index [18446744073709551615] is out of bounds for array of length 0

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2022-05-09T11:31:06Z
Last change time
2022-05-10T11:12:40Z
Keywords
ice-on-valid-code, industry, pull
Assigned to
No Owner
Creator
Iain Buclaw

Comments

Comment #0 by ibuclaw — 2022-05-09T11:31:06Z
No reduction yet, but it is obviously introduced by https://github.com/dlang/dmd/pull/14015
Comment #1 by ibuclaw — 2022-05-09T14:05:40Z
This is a fail_compilation reduction. --- auto ice23097(I)(I) { ICE; } struct Cpctor23097 { this(ref typeof(this) ) { } } struct S23097 { Cpctor23097 cpctor; } auto fail23097(S23097 s) { s.ice23097; } ---
Comment #2 by ibuclaw — 2022-05-09T22:46:13Z
This is a compilable reduction. --- void emplaceRef(UT, Args)(UT chunk, Args args) { static if (__traits(compiles, chunk = args)) chunk; } struct CpCtor23097(T) { T* payload; this(ref inout typeof(this)) { } ref opAssign(typeof(this)) { } } struct S23097 { CpCtor23097!int adjustments; } void test23097(S23097 lhs, const(S23097) rhs) { emplaceRef(lhs, rhs); }
Comment #3 by dlang-bot — 2022-05-10T09:34:20Z
@ibuclaw created dlang/dmd pull request #14101 "fix Issue 23097 - [REG 2.100] ArrayIndexError@src/dmd/mtype.d(4767): index [$-1] is out of bounds for array of length 0" fixing this issue: - fix Issue 23097 - [REG 2.100] ArrayIndexError@src/dmd/mtype.d(4767): index [18446744073709551615] is out of bounds for array of length 0 https://github.com/dlang/dmd/pull/14101
Comment #4 by dlang-bot — 2022-05-10T11:12:40Z
dlang/dmd pull request #14101 "fix Issue 23097 - [REG 2.100] ArrayIndexError@src/dmd/mtype.d(4767): index [$-1] is out of bounds for array of length 0" was merged into stable: - b8df705ac750d84910bf74f7c7c8a23dcb0319f0 by Iain Buclaw: fix Issue 23097 - [REG 2.100] ArrayIndexError@src/dmd/mtype.d(4767): index [18446744073709551615] is out of bounds for array of length 0 https://github.com/dlang/dmd/pull/14101