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 Conditional Assignments #5226

Merged
merged 1 commit into from
Jan 14, 2025

Conversation

DavidBakerEffendi
Copy link
Collaborator

The more semantically sound version of the current lowering checks for all "falsey" states of a variable instead of only the nil condition. Thus, the lowering is changed as follows: aaa ||= bbb becomes aaa = bbb if !aaa
aaa &&= bbb becomes aaa = bbb if aaa`

The more semantically sound version of the current lowering checks for all "falsey" states of a variable instead of only the nil condition. Thus, the lowering is changed as follows:
`aaa ||= bbb` becomes `aaa = bbb if !aaa`
`aaa &&= bbb` becomes aaa = bbb if aaa`
@DavidBakerEffendi DavidBakerEffendi added the ruby Relates to rubysrc2cpg label Jan 14, 2025
@DavidBakerEffendi DavidBakerEffendi self-assigned this Jan 14, 2025
@DavidBakerEffendi DavidBakerEffendi merged commit ef1f547 into master Jan 14, 2025
5 checks passed
@DavidBakerEffendi DavidBakerEffendi deleted the dave/ruby/conditional-assign-rework 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