[Issue 23175] -preview=in silently adds possible stack memory escape

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Jun 16 15:44:16 UTC 2022


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

--- Comment #11 from Steven Schveighoffer <schveiguy at gmail.com> ---
(In reply to Mathias LANG from comment #9)
> You should have led with this. That's what `-transition` is for. It lists
> all instances of `in` usage so you can inspect them.

Thanks, I didn't know about this switch. However, it just lists all the places
where `in` is a parameter, even ones where it is effectively const, i.e.:

`void foo(in int x){}`

It doesn't warn about the problems here.

I also get 100 listings of `in` on parameters in `object.d`, probably all of
which are fine. This isn't helpful. The compiler can do better, it knows when
it might try this optimization, I don't.

--


More information about the Digitalmars-d-bugs mailing list