-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Ruby: Rework (hash) splat argument/parameter matching #17222
Ruby: Rework (hash) splat argument/parameter matching #17222
Conversation
b6fe05b
to
3ca4888
Compare
any(SynthSplatArgumentShiftNode shift | | ||
shift = TSynthSplatArgumentShiftNode(_, actualSplat, _) | ||
).storeInto(this, _) |
Check warning
Code scanning / CodeQL
Expression can be replaced with a cast Warning
shift
185836e
to
f0c761a
Compare
I have pushed two new commits:
|
f0c761a
to
d15e1b5
Compare
A note on the additional results reported by DCA: The DCA run before c4b0f81 (which removes some false positive flow) shows a bunch of new results. This is because we now correctly identify more true positive flow, as witnessed by the test added in the last commit (which would fail on |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tokens
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
__
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yu
Inspired by @asgerf's PR, this PR rewrites the logic for how Ruby handles splat arguments and parameters. Instead of using a separate
Content
type to perform the matching, we make use of different argument/parameter positions in order to prevent synthetic splat arguments from being matched with synthetic splat parameters.Not only does this rewrite simplify the code, we also get a significant speedup (12% end-to-end analysis speedup on average). This is because the early data flow pruning stages have precise argument/parameter position matching, wheres precise content matching only happens in later pruning stages.