dmd icon indicating copy to clipboard operation
dmd copied to clipboard

fix Issue 20809 - return statement might access memory from destructe…

Open WalterBright opened this issue 2 years ago • 3 comments

…d temporary

Shouldn't take a pointer into an object about to be destructed.

WalterBright avatar Aug 09 '22 08:08 WalterBright

Thanks for your pull request, @WalterBright!

Bugzilla references

Auto-close Bugzilla Severity Description
20809 regression return statement might access memory from destructed temporary

⚠️⚠️⚠️ Warnings ⚠️⚠️⚠️

To target stable perform these two steps:

  1. Rebase your branch to upstream/stable:
git rebase --onto upstream/stable upstream/master
  1. Change the base branch of your PR to stable

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

dlang-bot avatar Aug 09 '22 08:08 dlang-bot

FYI @kinke, this is a fix in the codegen pass. As far as I can tell, GDC is unaffected by the bug, so I'd assume LDC is safe too.

ibuclaw avatar Aug 09 '22 13:08 ibuclaw

Thx for the ping Iain; LDC (v1.29 on run.dlang.io) is apparently fine for the runnable testcase.

kinke avatar Aug 09 '22 13:08 kinke

This pull request introduced a regression: https://issues.dlang.org/show_bug.cgi?id=24050

CyberShadow avatar Jul 19 '23 14:07 CyberShadow

@WalterBright Kind ping, the above is a codegen regression.

CyberShadow avatar Aug 25 '23 09:08 CyberShadow

BuildKite is currently red because of this regression.

@WalterBright @RazvanN7

CyberShadow avatar Aug 29 '23 16:08 CyberShadow