CTFE scrubReturnValue(): fix omission
Skipping this case led to a dangling reference to deleted Region allocations, i.e. memory corruption. Don't have a reasonable test case for it - spent 3 days till I found it :-(
This PR is just the fix. I plan later to do a refactoring on it to make the code saner.
Thanks for your pull request, @WalterBright!
Bugzilla references
Your PR doesn't reference any Bugzilla issue.
If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog.
Testing this PR locally
If you don't have a local development environment setup, you can use Digger to test this PR:
dub run digger -- build "master + dmd#10458"
Looks like I have more work to do on this, sigh.
When newCTFE is in, at least these kinds of bugs are virtually impossible.
Since all returned values have to go through a transform which creates a dmd expression,
node from a newCTFE-Value.
@WalterBright "fix omission" is not a good commit message. Especially if it's an obscure case. As soon as this is ready please do adjust the commit message to a few sentences which would explain to someone who is not familiar with the issue, what the issue was and why the solution you have for it is correct.
I personally do this all the time now for things which are bugfixes intended for merge.
@WalterBright, I fixed a similar bug some time ago, a self reference got allocated in the stack but escaped to other contexts. See #13109 Maybe it's the same.