Skip to content

[c2cpg] Refactor AST creation for functions, types, fields - #5895

Merged
max-leuthaeuser merged 6 commits into
masterfrom
max/issue8804
Mar 26, 2026
Merged

max-leuthaeuser merged 6 commits into
masterfrom
max/issue8804

Conversation

@max-leuthaeuser

@max-leuthaeuser max-leuthaeuser commented Mar 23, 2026

Copy link
Copy Markdown
Contributor
  • Fix typeRefIdStack usage and related usage in type AST creation; stop producing standalone TypeRef nodes under TypeDecls.
  • Revise fieldAccesses to produce nested call ASTs with FieldIdentifier nodes for qualified names (supports multiple :: parts correctly).
  • Update FunctionDeclNodePass to use fullNameExact when querying typeDecls.
  • Update tests.

Fixes: https://github.com/ShiftLeftSecurity/codescience/issues/8804

- Fix typeRefIdStack usage and related usage in type AST creation; stop producing standalone TypeRef nodes under TypeDecls.
- Improve handling of unresolved/problem bindings: treat IProblemBinding like IFunction so we can still create proper method fullNames and avoid placing Unknown expression nodes directly under TypeDecls.
- Revise fieldAccesses to produce nested call ASTs with FieldIdentifier nodes for qualified names (supports multiple :: parts correctly).
- Adjust unknown node logging: do not generate Unknown nodes for unparsed nodes under TypeDecls and add a clearer not-parsed message suggesting --with-include-auto-discovery.
- Update FunctionDeclNodePass to use fullNameExact when querying typeDecls.
- Update tests.

Fixes: ShiftLeftSecurity/codescience#8804
@max-leuthaeuser
max-leuthaeuser requested a review from ml86 March 25, 2026 06:17
Resolved import conflicts in c2cpg:
- AstCreator.scala: added AstCreationPass import, split x2cpg imports
- CustomFileContentProvider.scala: split scanner imports, removed unused LoggerFactory
- AstCreationPass.scala: deduplicated imports, removed CGlobal, split grouped imports
- PreprocessorPass.scala: removed CGlobal import, split grouped parser imports
@max-leuthaeuser
max-leuthaeuser merged commit d360978 into master Mar 26, 2026
8 checks passed
@max-leuthaeuser
max-leuthaeuser deleted the max/issue8804 branch March 26, 2026 07:12
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