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

[rubysrc2cpg] Fixed Bug with Higher-Order Functions #3708

Merged
merged 2 commits into from
Oct 2, 2023

Conversation

DavidBakerEffendi
Copy link
Collaborator

When chained calls are made, there may be a higher order function spawned from some sort of do-block. As these do-blocks now also give the method and type in the AST, these needed to be separated as to not become arguments to a call.

This PR fixes this case by extracting these from a call's arguments and placing them before a call node in the sequence of AST nodes.

May fix #3693

When chained calls are made, there may be a higher order function spawned from some sort of do-block. As these do-blocks now also give the method and type in the AST, these needed to be separated as to not become arguments to a call.

This PR fixes this case by extracting these from a call's arguments and placing them before a call node in the sequence of AST nodes.

May fix #3693
@DavidBakerEffendi DavidBakerEffendi added the ruby Relates to rubysrc2cpg label Oct 2, 2023
@DavidBakerEffendi DavidBakerEffendi self-assigned this Oct 2, 2023
@DavidBakerEffendi DavidBakerEffendi merged commit 3e9ea97 into master Oct 2, 2023
@DavidBakerEffendi DavidBakerEffendi deleted the dave/ruby/do-block-in-high-func branch October 2, 2023 09:27
DavidBakerEffendi added a commit that referenced this pull request Oct 4, 2023
Generalized the solution from PR #3708 by applying it to other call argument construction.

Fixes #3693
DavidBakerEffendi added a commit that referenced this pull request Oct 4, 2023
Generalized the solution from PR #3708 by applying it to other call argument construction.

Fixes #3693
khemrajrathore added a commit to Privado-Inc/joern that referenced this pull request Oct 10, 2023
khemrajrathore added a commit to Privado-Inc/joern that referenced this pull request Oct 10, 2023
khemrajrathore added a commit to Privado-Inc/joern that referenced this pull request Oct 10, 2023
khemrajrathore added a commit to Privado-Inc/joern that referenced this pull request Oct 10, 2023
DavidBakerEffendi pushed a commit that referenced this pull request Oct 11, 2023
* Revert "[rubysrc2cpg] Do-Block Function as Conditional (#3729)"

This reverts commit c726bb5.

* Revert "[rubysrc2cpg] Chained Higher Order Methods (#3727)"

This reverts commit 39dd417.

* Revert "[rubysrc2cpg] Fixed Duplicate Do-Blocks Due to Side-Effect (#3720)"

This reverts commit 3f0e745.

* Revert "[rubysrc2cpg] Comprehensive follow up to #3708's fix (#3714)"

This reverts commit 662bd23.

* Revert "[rubysrc2cpg] Fixed Bug with Higher-Order Functions (#3708)"

This reverts commit 3e9ea97.

* Revert "[rubysrc2cpg] General Do-Block Function Fixes (#3676)"

This reverts commit 4ef5cdc.
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.

[Ruby] - Loss in flows after joern version 2.0.92
2 participants