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

[ruby] Rework In Pattern Match Overtainting #5227

Merged
merged 2 commits into from
Jan 14, 2025

Conversation

DavidBakerEffendi
Copy link
Collaborator

This change reworks the means of extracting the variables from an array pattern match by using an index access corresponding to the location we want to extract. e.g.

case [type, location]
in [:value, result]
  puts "#{result}"
else
  puts "else"
end

Accesses result by <tmp-0>[1] (where <tmp-0> = [type, location])

This change reworks the means of extracting the variables from an array pattern match by using an index access corresponding to the location we want to extract. e.g.
```ruby
case [type, location]
in [:value, result]
  puts "#{result}"
else
  puts "else"
end
```
Accesses `result` by `<tmp-0>[1]` (where `<tmp-0> = [type, location]`)
@DavidBakerEffendi DavidBakerEffendi added the ruby Relates to rubysrc2cpg label Jan 14, 2025
@DavidBakerEffendi DavidBakerEffendi self-assigned this Jan 14, 2025
@DavidBakerEffendi DavidBakerEffendi merged commit 03980ff into master Jan 14, 2025
5 checks passed
@DavidBakerEffendi DavidBakerEffendi deleted the dave/ruby/rework-in-array-match branch January 14, 2025 10:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ruby Relates to rubysrc2cpg
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants