[Issue 21957] ice when dmd computes the alignment of an union containing a noreturn

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Oct 11 07:53:22 UTC 2021


https://issues.dlang.org/show_bug.cgi?id=21957

Dlang Bot <dlang-bot at dlang.rocks> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #3 from Dlang Bot <dlang-bot at dlang.rocks> ---
dlang/dmd pull request #13142 "Fix 21957 - Don't crash when aligning noreturn
members " was merged into stable:

- 3377fa7d85edb97311265f0713b00113cdfd6534 by MoonlightSentinel:
  Fix 21957 - Don't crash when aligning noreturn members

  `alignmember` assumes that every type with default alignment has a size
  greater than zero - which obviously does not apply for `noreturn`.

  A `noreturn` field with default alignment does not affect the layout of
  the aggregate because `noreturn.sizeof = noreturn.alignof = 0`. Hence
  skip the `alignmember` call unless a custom alignment was requested.

https://github.com/dlang/dmd/pull/13142

--


More information about the Digitalmars-d-bugs mailing list