tail calls: fix copying non-scalar arguments to callee#150473
tail calls: fix copying non-scalar arguments to callee#150473RalfJung wants to merge 1 commit intorust-lang:mainfrom
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? |
|
☔ The latest upstream changes (presumably #152701) made this pull request unmergeable. Please resolve the merge conflicts. |
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