Skip to content

YJIT: Fix SP index with optarg and unordered kwarg #5379

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

Merged
merged 1 commit into from
Jan 1, 2022

Conversation

jhawthorn
Copy link
Member

Previously when we were calling a method with an optional argument and multiple keywords arguments which weren't in the order the receiver expected we would use the wrong SP index to rearrange them.

Fixes Bug #18453

Previously when we were calling a method with an optional argument and
multiple keywords arguments which weren't in the order the receiver
expected we would use the wrong SP index to rearrange them.

Fixes Bug #18453
@jhawthorn jhawthorn force-pushed the yjit_fix_kwarg_optarg_index branch from 9f79844 to 78fe451 Compare December 30, 2021 21:55
Copy link
Member

@XrXr XrXr left a comment

Choose a reason for hiding this comment

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

Thanks for tracking this down. Sorry I didn't catch this when reviewing #5285. Now I really need to write a fuzzer to test this code. Others can approve this if they want, but I'm not comfortable doing so before I do some randomized property based testing. This is the fourth miscompilation bug from keyword args handling now. 1234

Footnotes

  1. cffa116

  2. ac5d6fa

  3. c2197bf

  4. https://bugs.ruby-lang.org/issues/18453

@jhawthorn
Copy link
Member Author

Trying a fuzzer/property based testing is a good idea.

I'm going to merge as we know this fixes the current issue.

@jhawthorn jhawthorn merged commit 5414de4 into ruby:master Jan 1, 2022
@jhawthorn jhawthorn deleted the yjit_fix_kwarg_optarg_index branch January 1, 2022 01:35
noahgibbs added a commit to Shopify/ruby that referenced this pull request Mar 7, 2022
noahgibbs added a commit to Shopify/ruby that referenced this pull request Mar 7, 2022
maximecb pushed a commit to Shopify/ruby that referenced this pull request Mar 7, 2022
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.

3 participants