Bug 23959 – [REG2.101.0] Copying arrays of types with postblits from varargs broken

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2023-06-03T22:23:11Z
Last change time
2023-06-13T10:10:55Z
Keywords
pull, wrong-code
Assigned to
Teodor Dutu
Creator
Vladimir Panteleev

Comments

Comment #0 by dlang-bugzilla — 2023-06-03T22:23:11Z
//////// test.d /////// struct ST() { int i; this(this) {} } alias S = ST!(); void poison() { static S g; auto s = g; } S[1] sa; void fun(S[] values...) { sa[] = values; } unittest { fun(S(1)); assert(sa[0].i); } /////////////////////// Introduced in https://github.com/dlang/dmd/pull/14310
Comment #1 by dlang-bot — 2023-06-05T00:49:34Z
@teodutu created dlang/dmd pull request #15295 "Move lowerings to `_d_array{setassign,assign_{l,r}}` to a `LoweredAssignExp` AST node" mentioning this issue: - Move lowerings to `_d_array{setassign,assign_{l,r}}` to a `LoweredAssignExp` AST node This PR does the following: - uses a `LoweredAssignExp` node for assignmets that lower to `_d_arrayassign_{l,r}` - removes the code in `dinterpret.d` that recreates the original `AssigExp` - simplifies `isArrayConstructionOrAssign()` to just `isArrayConstruction()` since assignments are now handled by a separate AST node - fixes issue 23959 Signed-off-by: Teodor Dutu <[email protected]> https://github.com/dlang/dmd/pull/15295
Comment #2 by dlang-bot — 2023-06-13T06:44:19Z
@teodutu created dlang/dmd pull request #15315 "Fix Issue 23959 - Propagate deprecation to `_d_arrayappendcTXImpl` if the calling scope is deprecated" fixing this issue: - Fix Issue 23959 - Propagate deprecation to `_d_arrayappendcTXImpl` if the calling scope is deprecated This is needed if the lowered expression (`arr ~= elem`) is made within a deprecated context to avoid spurious deprecation messages about the hook being emitted. Signed-off-by: Teodor Dutu <[email protected]> https://github.com/dlang/dmd/pull/15315
Comment #3 by dlang-bot — 2023-06-13T10:10:55Z
dlang/dmd pull request #15295 "Move lowerings to `_d_array{setassign,assign_{l,r}}` to a `LoweredAssignExp` AST node" was merged into stable: - 196d3a4c0649094353b56fb3af81cccc014ee8c8 by Teodor Dutu: Fix Issue 23959 - Move lowerings to `_d_array{setassign,assign_{l,r}}` to a `LoweredAssignExp` AST node The compiler now uses a `LoweredAssignExp` node for assignmets that lower to `_d_arrayassign_{l,r}` Signed-off-by: Teodor Dutu <[email protected]> https://github.com/dlang/dmd/pull/15295