[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
Wed Aug 25 17:07:57 UTC 2021


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

--- Comment #2 from Ate Eskola <Ajieskola at gmail.com> ---
There appears to be two bugs, one in vanilla DMD and one with -dip1000.

As Dennis said, my initial example fails to compile regardless of the compiler
switches used. But there is a watered-down version of my workaround:

```d
int* f()
{ int x = 42;
  auto wannaBePointer = &x;
  return wannaBePointer;
}
```

This one compiles with vanilla DMD, but the -dip1000 bug prevents compiling it
with the said flag.

The full workaround in the initial example still compiles with the flag too.

--


More information about the Digitalmars-d-bugs mailing list