Bug 21950 – cod1: Assertion failure for noreturn parameter

Status
RESOLVED
Resolution
FIXED
Severity
major
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2021-05-21T21:36:19Z
Last change time
2021-10-21T21:39:24Z
Keywords
backend, pull
Assigned to
No Owner
Creator
moonlightsentinel
See also
https://issues.dlang.org/show_bug.cgi?id=21952, https://issues.dlang.org/show_bug.cgi?id=21951

Comments

Comment #0 by moonlightsentinel — 2021-05-21T21:36:19Z
The following code triggers an assertion failure in the backend: ========================================= alias noreturn = typeof(*null); void foo(noreturn); void overloads() { noreturn n; foo(n); } ========================================= Assertion failed: 0, file src\dmd\backend\cod1.d, line 4214
Comment #1 by dlang-bot — 2021-10-16T16:00:23Z
@MoonlightSentinel updated dlang/dmd pull request #13179 "e2ir: Rewrite function calls depending on noreturn arguments " fixing this issue: - Fix 21950: Rewrite function calls depending on noreturn arguments Replaces the function call with the evaluation of the arguments up to the first `noreturn` parameter. The remaining arguments / the function call will never be executed anyways and the backend cannot handle noreturn parameters. https://github.com/dlang/dmd/pull/13179
Comment #2 by dlang-bot — 2021-10-17T01:52:28Z
dlang/dmd pull request #13179 "Fix 21950: Rewrite function calls depending on noreturn arguments " was merged into stable: - 783821f852836d3acd4fd815b1ef8f2161f33010 by MoonlightSentinel: Fix 21950: Rewrite function calls depending on noreturn arguments Replaces the function call with the evaluation of the arguments up to the first `noreturn` parameter. The remaining arguments / the function call will never be executed anyways and the backend cannot handle noreturn parameters. https://github.com/dlang/dmd/pull/13179
Comment #3 by dlang-bot — 2021-10-21T21:39:24Z
dlang/dmd pull request #13209 "Merge stable into master" was merged into master: - 4a60861c30e8e6b8193ad5c531c15b3c9837430f by MoonlightSentinel: Fix 21950: Rewrite function calls depending on noreturn arguments Replaces the function call with the evaluation of the arguments up to the first `noreturn` parameter. The remaining arguments / the function call will never be executed anyways and the backend cannot handle noreturn parameters. https://github.com/dlang/dmd/pull/13209