-
-
Notifications
You must be signed in to change notification settings - Fork 14.4k
tail calls: fix copying non-scalar arguments to callee #150473
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
base: main
Are you sure you want to change the base?
Conversation
This comment has been minimized.
This comment has been minimized.
3604bf5 to
0d2a400
Compare
|
☔ The latest upstream changes (presumably #150565) made this pull request unmergeable. Please resolve the merge conflicts. |
0d2a400 to
1bccfe8
Compare
This comment has been minimized.
This comment has been minimized.
|
I looked into this some at #144855 (comment). In summary, I believe that a tail call that uses an argument that is Supporting |
1bccfe8 to
b3bdf0f
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
|
Thanks, I had not seen that issue! What a mess. Whatever rules we come up with should be portable to all targets... Anyway, that's mostly orthogonal to what we do in the interpreter. Fixing the order in which we copy arguments and deallocate the old locals still makes sense IMO. |
|
@WaffleLapkin just a friendly ping -- are you okay with reviewing this or should I find another reviewer? |
Alternative to #144933: when invoking a tail call with a non-scalar argument, we need to delay freeing the caller's local variables until after the callee is initialized, so that we can copy things from the caller to the callee.
Fixes #144820... but as the FIXMEs in the code show, it's not clear to me whether these are the right semantics.
r? @WaffleLapkin