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 indirect call stack return handling #397

Merged
merged 2 commits into from
Oct 3, 2024
Merged

Conversation

rinon
Copy link
Collaborator

@rinon rinon commented Sep 27, 2024

We don't save the function pointer to the stack anymore, so we shouldn't be adding a slot in the indirect call wrapper case. This wasn't breaking anything unless we had a return value on the stack.

Fixes #396

@rinon rinon requested a review from fw-immunant September 27, 2024 00:51
@ayrtonm ayrtonm assigned ayrtonm and unassigned ayrtonm Oct 1, 2024
@rinon rinon requested a review from ayrtonm October 1, 2024 19:37
@ayrtonm ayrtonm requested review from ayrtonm and removed request for ayrtonm October 1, 2024 19:37
@ayrtonm
Copy link
Contributor

ayrtonm commented Oct 1, 2024

The part where you remove the stack slot looks good to me. I'm not sure if we need the .set << wrapper_name ... though. I thought that was a case where the rewriter shouldn't emit annotations in the first place but I've only briefly skimmed that part so far.

Copy link
Contributor

@ayrtonm ayrtonm left a comment

Choose a reason for hiding this comment

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

LGTM

@ayrtonm
Copy link
Contributor

ayrtonm commented Oct 3, 2024

oh there's a TODO comment we can remove above the .set directive

rinon added 2 commits October 3, 2024 10:44
We don't save the function pointer to the stack anymore, so we shouldn't be adding a slot in the indirect call wrapper case. This wasn't breaking anything unless we had a return value on the stack.
@rinon rinon force-pushed the sjc/indirect_stack_ret branch from e3a8796 to bfbb857 Compare October 3, 2024 17:44
@rinon rinon merged commit 521a2ca into main Oct 3, 2024
34 checks passed
@rinon rinon deleted the sjc/indirect_stack_ret branch October 3, 2024 17:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Indirect calls that return a value on the stack are broken
2 participants