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

Allow closure bindings on method parameters #1739

Conversation

DavidBakerEffendi
Copy link
Contributor

@DavidBakerEffendi DavidBakerEffendi commented Nov 7, 2023

The description for CLOSURE_BINDING is: "Represents the binding of a LOCAL or METHOD_PARAMETER_IN into the closure of a method", however there is no edge connecting parameters to the CLOSURE_BINDING. So this adds the CLOSURE_BINDING_ID and CAPTURED_BY edge to match the specification for LOCAL nodes.

Additionally, the cardinality needs to be changed, since if a method parameter is captured, then there won't be a REF to a local which may throw an error. Thus, cardinality was changed to ZeroOrOne.

DavidBakerEffendi added a commit to joernio/joern that referenced this pull request Nov 7, 2023
The closure bindings for Java lambdas are over-approximated to all variables in the surrounding context. This attempts to constrain this set to variables referenced in the AST body.

Note: ShiftLeftSecurity/codepropertygraph#1739

Resolves #3790
DavidBakerEffendi added a commit to joernio/joern that referenced this pull request Nov 10, 2023
The closure bindings for Java lambdas are over-approximated to all variables in the surrounding context. This attempts to constrain this set to variables referenced in the AST body.

Note: ShiftLeftSecurity/codepropertygraph#1739

Resolves #3790
@fabsx00 fabsx00 merged commit a07c942 into ShiftLeftSecurity:master Nov 15, 2023
1 check passed
@DavidBakerEffendi DavidBakerEffendi deleted the dave/closures/method-param-closure-id branch November 15, 2023 11:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants