dmd icon indicating copy to clipboard operation
dmd copied to clipboard

another correction for caller destroying args

Open WalterBright opened this issue 1 year ago • 5 comments

This is a fix for this problem:

https://github.com/dlang/dmd/pull/16145#issuecomment-1932776873

In case that PR never gets pulled. Don't know how to trigger the test case without the rest of that PR.

The problem is that functions that return a static array with elements that need to be destructed should not be inlined, because the e2ir.d code no longer will call _d_arrayctor() to do it.

WalterBright avatar Feb 08 '24 07:02 WalterBright

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#16167"

dlang-bot avatar Feb 08 '24 07:02 dlang-bot

This is ready to merge.

WalterBright avatar Feb 16 '24 07:02 WalterBright

does this fix anything? Why does it not have a test suite change?

thewilsonator avatar Feb 16 '24 08:02 thewilsonator

It's a partial fix for https://github.com/dlang/dmd/pull/16145 . If we don't go with 16415, this fix is still important in case of a change of mind in the future. But it cannot be tested without implementing 16145.

I.e. the code promises that caller/callee destruction is set by a flag in target.d. It should keep its promise!

WalterBright avatar Feb 16 '24 08:02 WalterBright

There's a PR for removing the frontend inliner. #16173

ibuclaw avatar Feb 16 '24 10:02 ibuclaw