Skip to content

Conversation

asgerf
Copy link
Contributor

@asgerf asgerf commented Oct 21, 2022

Kudos to @aibaars for the implementation (pushed directly to this PR).

Constants can be used in compound assignments but were not previously desugared, creating holes in the CFG:

MyConst ||= 123

@asgerf asgerf added the no-change-note-required This PR does not need a change note label Oct 21, 2022
@github-actions github-actions bot added the Ruby label Oct 21, 2022
asgerf added a commit to asgerf/codeql that referenced this pull request Oct 23, 2022
@asgerf asgerf marked this pull request as ready for review October 24, 2022 10:47
@asgerf asgerf requested a review from a team as a code owner October 24, 2022 10:47
Copy link
Contributor Author

@asgerf asgerf 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 fixing this @aibaars! I did a slow and steady read through the implementation and AFAICT everything looks good.

The evaluation backlinked above looks great, neutral perf, +250 call edges, and +15 sinks.

However, I can't approve my own PR. Feel free to post an approval yourself 😄

@asgerf asgerf changed the title Ruby: add test for compound constant-assignment Ruby: handle compound constant-assignment Oct 24, 2022
@asgerf asgerf merged commit bcfe4ec into github:main Oct 24, 2022
Comment on lines +894 to +898
// constant accesses with scope expression in compound assignments are desugared
not (
this = any(AssignOperation op).getLeftOperand() and
exists(this.getScopeExpr())
)
Copy link
Contributor

Choose a reason for hiding this comment

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

@aibaars : It would be better to use Synthesis::excludeFromControlFlowTree for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-change-note-required This PR does not need a change note Ruby
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants