Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix 23497 - Erroneous escape reference to parameter error #14686

Merged
merged 1 commit into from Dec 12, 2022

Conversation

dkorpel
Copy link
Contributor

@dkorpel dkorpel commented Dec 12, 2022

Supersedes the revert #14677

@dkorpel dkorpel added the dip1000 memory safety with scope, ref, return label Dec 12, 2022
@dlang-bot
Copy link
Contributor

Thanks for your pull request and interest in making D better, @dkorpel! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please verify that your PR follows this checklist:

  • My PR is fully covered with tests (you can see the coverage diff by visiting the details link of the codecov check)
  • My PR is as minimal as possible (smaller, focused PRs are easier to review than big ones)
  • I have provided a detailed rationale explaining my changes
  • New or modified functions have Ddoc comments (with Params: and Returns:)

Please see CONTRIBUTING.md for more information.


If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment.

Bugzilla references

Auto-close Bugzilla Severity Description
23497 regression Erroneous escape reference to parameter error.

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 "stable + dmd#14686"

@@ -1799,7 +1799,7 @@ void escapeByValue(Expression e, EscapeByResults* er, bool live = false, bool re
if (tf.isreturn)
stc |= STC.return_;
if (tf.isreturnscope)
stc |= STC.returnScope;
stc |= STC.returnScope | STC.scope_;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's nuts that we have to do this though...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, I intend to improve it in future PRs, this is just the quickest path to fix the regression. I've been looking already into fixing returnScope inference without scope, but it breaks Phobos somehow.

@Geod24
Copy link
Member

Geod24 commented Dec 12, 2022

@deadalnix : Care to give this a spin before I merge it, to make sure it fixes the non-reduced problem?

@deadalnix
Copy link
Contributor

I'm unable to run the compiler on the whole project, so this will have to do.

Copy link
Member

@maxhaton maxhaton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

crazy but it'll do

@maxhaton maxhaton merged commit 52c5e2f into dlang:stable Dec 12, 2022
@dkorpel dkorpel deleted the retscope-contract branch December 12, 2022 22:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Fix dip1000 memory safety with scope, ref, return
Projects
None yet
5 participants