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] Fix orphan local class identifiers #5216

Closed
wants to merge 1 commit into from

Conversation

johannescoetzee
Copy link
Contributor

@johannescoetzee johannescoetzee commented Jan 9, 2025

usedCaptures contains an outerClass local which exists mostly to provide type information and should not be added to the CPG. Normally this would not happen, but this caused an issue with this() calls in constructor bodies where the constructor has an outerClass parameter which should be passed through this, but the REF edge was instead being created to the type-info-only local. This PR fixes this issue by correctly creating the ref edge to the outerClass parameter instead. There's definitely a more robust way to fix this, but that would probably require significantly larger changes to how capture information is stored.

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.

1 participant