[Issue 22587] ternary with function call and assert(0) leads to cod1 assertion

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Aug 4 10:11:27 UTC 2022


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

kdevel <kdevel at vogtner.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kdevel at vogtner.de

--- Comment #4 from kdevel <kdevel at vogtner.de> ---
(In reply to mhh from comment #2)
> More detail, seems to require -O to go boom

z1.d
----
void foo (int i)
{
   int j = i == 1
      ? 7
      : assert (0);
}

$ dmd z1
Illegal instruction
$  dmd --version
DMD64 D Compiler v2.100.0
Copyright (C) 1999-2022 by The D Language Foundation, All Rights Reserved
written by Walter Bright

--


More information about the Digitalmars-d-bugs mailing list