Bug 22042 – shared(delegate[]) causes dmd to fail

Status
NEW
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2021-06-19T09:33:14Z
Last change time
2024-12-13T19:17:07Z
Keywords
pull
Assigned to
No Owner
Creator
Sergej Efimov
Moved to GitHub: dmd#19948 →

Comments

Comment #0 by incsall — 2021-06-19T09:33:14Z
The minimal reproducible example: ---------------------- struct Event { } shared(void delegate()[]) onRelease; void subscribe(E)() { onRelease ~= (){}; } void main() { subscribe!Event; } ---------------------- And result (running with dub a minimal application): Performing "debug" build using /Library/D/dmd/bin/dmd for x86_64. dtest ~master: building configuration "application"... /Library/D/dmd/bin/dmd failed with exit code -11. dmd version: DMD64 D Compiler v2.097.0
Comment #1 by moonlightsentinel — 2021-06-20T12:05:06Z
Tagged as backend because the error happens in the DMD-specific glue layer (run.dlang.io suggests an assertion failure in todt.c)
Comment #2 by moonlightsentinel — 2021-11-05T23:26:29Z
Actually not a backend issue, the error is caused by a missing deco for the `TypeDelegate` which wasn't set by merge.
Comment #3 by moonlightsentinel — 2021-11-05T23:27:13Z
Worked up until 2.064 according to run.dlang.io
Comment #4 by moonlightsentinel — 2021-11-05T23:27:51Z
Further reduction: shared(void delegate()[]) onRelease; void main() { onRelease ~= (){}; }
Comment #5 by dlang-bot — 2021-11-05T23:46:57Z
@MoonlightSentinel created dlang/dmd pull request #13271 "Fix 22042 - Merge `funcptr` type before merging `TypeDelegate`'s" fixing this issue: - Fix 22042 - Merge `funcptr` type before merging `TypeDelegate`'s Ensures that `deco` is set for the `funcptr` (`next`) whenever possible s.t. `merge` doesn't exit early in the `default` case. Previously `TypeDelegate`s without `deco` could reach the `TypeInfo` generation and trigger the assertion due to the missing mangling string. Also could cause problems with non-unique types but didn't find a test case (yet?). https://github.com/dlang/dmd/pull/13271
Comment #6 by robert.schadek — 2024-12-13T19:17:07Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/19948 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB