Weird codegen bug

Daniel Kozak kozzi11 at gmail.com
Thu Jun 13 11:50:19 UTC 2019


ldc will print
9
9
and sigsegv :D

On Thu, Jun 13, 2019 at 1:30 PM RazvanN via Digitalmars-d <
digitalmars-d at puremagic.com> wrote:

> import std.stdio : writeln;
>
> void main()
> {
>      int a = 7;
>      int b = 9;
>
>      /* some code later */
>
>      *(&a + 1) = 2;
>      writeln(b);
>      writeln(b);
> }
>
> This code prints:
>
> 9
> 2
>
> with latest version of dmd. Is this a bug or am I missing
> something? For the record,
> gdc prints (as expected):
>
> 2
> 2
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20190613/c71dd041/attachment.html>


More information about the Digitalmars-d mailing list