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

Basic implementation of following context-sensitive calls in followNextDFGUntilHit #1988

Merged
merged 6 commits into from
Jan 28, 2025

Conversation

oxisto
Copy link
Member

@oxisto oxisto commented Jan 26, 2025

I am not sure if this really solves all the problems, but at least this tries to use the information that we have in the calling context in/out so that we are properly following dataflows into functions and out of functions using the correct call (stack).

…extDFGUntilHit`

I am not sure if this really solves *all* the problems, but at least this tries to use the information that we have in the calling context in/out so that we are properly following dataflows into functions and out of functions using the correct call (stack).
@oxisto oxisto force-pushed the context-sensitive-follow-dfg branch from 7894803 to 053202e Compare January 26, 2025 14:54
@oxisto oxisto added the core label Jan 26, 2025
Copy link

codecov bot commented Jan 26, 2025

Codecov Report

Attention: Patch coverage is 86.79245% with 7 lines in your changes missing coverage. Please review.

Project coverage is 78.05%. Comparing base (c4037bb) to head (1f847aa).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...kotlin/de/fraunhofer/aisec/cpg/graph/Extensions.kt 86.79% 6 Missing and 1 partial ⚠️
Additional details and impacted files
Files with missing lines Coverage Δ
...kotlin/de/fraunhofer/aisec/cpg/graph/Extensions.kt 62.71% <86.79%> (+3.34%) ⬆️

... and 4 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@KuechA KuechA left a comment

Choose a reason for hiding this comment

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

I like that we will provide a context sensitive analysis. However, we should take care of few aspects:

  1. maintainability of the selection of the "next step" for followXUntilHit is getting increasingly complex with a number of similar code fragments (push on stack, pop from stack, select subset of edges, ...)
  2. prevDFG does not have this feature
  3. The computational complexity will increase if we cannot disable certain stacks in the long term. We should keep this in mind when running it on larger code bases and allow configuring the precision.
  4. Some functions already provide an interprocedural analysis and probably miss it (e.g. following the PDG, CDG), the EOG does not feature this at all.

I'm fine with the changes but we should discuss how to design a cleaner interface here in the next weeks.

@oxisto oxisto enabled auto-merge (squash) January 28, 2025 07:37
@oxisto oxisto merged commit d031b38 into main Jan 28, 2025
2 checks passed
@oxisto oxisto deleted the context-sensitive-follow-dfg branch January 28, 2025 07:40
oxisto added a commit that referenced this pull request Jan 28, 2025
…extDFGUntilHit` (#1988)

* Basic implementation of following context-sensitive calls in `followNextDFGUntilHit`

I am not sure if this really solves *all* the problems, but at least this tries to use the information that we have in the calling context in/out so that we are properly following dataflows into functions and out of functions using the correct call (stack).

* Added flakey test to demonstrate problem

* Using a cloned stack, but somehow still does not work

* More robust implementation

* Added self

* Addressed code review
oxisto added a commit that referenced this pull request Jan 28, 2025
…extDFGUntilHit` (#1988)

* Basic implementation of following context-sensitive calls in `followNextDFGUntilHit`

I am not sure if this really solves *all* the problems, but at least this tries to use the information that we have in the calling context in/out so that we are properly following dataflows into functions and out of functions using the correct call (stack).

* Added flakey test to demonstrate problem

* Using a cloned stack, but somehow still does not work

* More robust implementation

* Added self

* Addressed code review
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants