[Issue 22215] returning expired stack pointers in @system code allowed by spec, not by implementation

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Aug 16 19:55:37 UTC 2021


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

Dennis <dkorpel at live.nl> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dkorpel at live.nl
           Hardware|x86                         |All
            Summary|[dip1000] scope analysis    |returning expired stack
                   |does not respect @system or |pointers in @system code
                   |@trusted                    |allowed by spec, not by
                   |                            |implementation
           Severity|major                       |normal

--- Comment #1 from Dennis <dkorpel at live.nl> ---
It doesn't compile without -dip1000 either, the error predates it.

> this workaround should not be required.

Intentionally returning an expired stack pointer should be a very rare
occurrence, I think a workaround is warranted. However, the spec says:

> @system functions may perform any operation legal from the perspective of the language including inherently memory unsafe operations like returning pointers to expired stackframes

https://dlang.org/spec/memory-safe-d.html

So at least one has to change: the implementation, or the spec.

--


More information about the Digitalmars-d-bugs mailing list