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

[javasrc2cpg] add basic static field test #5075

Merged
merged 1 commit into from
Nov 7, 2024

Conversation

xavierpinho
Copy link
Contributor

Apropos #5049, includes an ignored test that stopped working after #5036. Unfortunately, such a test wasn't there before to flag this regression.

Previously, in the example's System.out.println(CONST) we were lowering CONST as Bar.CONST, with Bar an IDENTIFIER. Presently, Bar is a TYPE_REF and we lose this dataflow.

Another thing to point out regarding this design change is that it's not consistent throughout. For instance, if we had written System.out.println(Bar.CONST) , Bar is here not a TYPE_REF but again an IDENTIFIER.

I'm willing to contribute patch(es) to the recovery of this flow, but would need some guidance as I've not been able to find a workaround after some initial experiments. (Thanks in advance)

Copy link
Contributor

@johannescoetzee johannescoetzee left a comment

Choose a reason for hiding this comment

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

Good catch! I don't have much experience with the OSS dataflow engine so can't say much there, but I agree we should update the explicit Bar.CONST case as well. I'll add it to my TODO list for when I'm done with pattern matching support

@xavierpinho xavierpinho merged commit 6470dd7 into master Nov 7, 2024
5 checks passed
@xavierpinho xavierpinho deleted the xavierp/java-static-field-flow-test branch November 7, 2024 15:09
@xavierpinho xavierpinho added java Relates to javasrc2cpg dataflow engine Relates to dataflowengineoss labels Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dataflow engine Relates to dataflowengineoss java Relates to javasrc2cpg
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants