June 16, 2022 [Issue 23175] -preview=in silently adds possible stack memory escape | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=23175 --- Comment #11 from Steven Schveighoffer <schveiguy@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. -- |
June 16, 2022 [Issue 23175] -preview=in silently adds possible stack memory escape | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=23175 --- Comment #12 from Paul Backus <snarwin+bugzilla@gmail.com> --- The most straightforward fix would be to have the compiler emit a warning any time an `in` parameter escapes from a function in @system or @trusted code (i.e., the same thing it currently emits an error for in @safe code). If we don't want to make the warning part of `-preview=in` itself, having it enabled by `-transition=in` could also work (though I suspect the vast majority of users will never discover it there). -- |
June 16, 2022 [Issue 23175] -preview=in silently adds possible stack memory escape | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=23175 --- Comment #13 from Mathias LANG <pro.mathias.lang@gmail.com> --- > 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.: The `-transition` switch was put in place because `in` also means `ref`, which one may find "breaks code" (hint: it doesn't). The compiler *will* tell you when you're doing something wrong, though: With DIP1000 and @safe. As the spec says it will. -- |
December 17, 2022 [Issue 23175] -preview=in silently adds possible stack memory escape | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=23175 Iain Buclaw <ibuclaw@gdcproject.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Priority|P1 |P4 -- |
Copyright © 1999-2021 by the D Language Foundation