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

Simplified and more basic fixpoint iteration for UnreachableEOGPass #1811

Open
wants to merge 83 commits into
base: main
Choose a base branch
from

Conversation

KuechA
Copy link
Contributor

@KuechA KuechA commented Nov 5, 2024

This PR adapts the UnreachableEOGPass to the new fixpoint iteration implementation

Copy link

codecov bot commented Nov 5, 2024

Codecov Report

Attention: Patch coverage is 86.76471% with 9 lines in your changes missing coverage. Please review.

Project coverage is 78.24%. Comparing base (edd5068) to head (76afe7a).

Files with missing lines Patch % Lines
.../fraunhofer/aisec/cpg/passes/UnreachableEOGPass.kt 86.76% 1 Missing and 8 partials ⚠️
Additional details and impacted files
Files with missing lines Coverage Δ
.../fraunhofer/aisec/cpg/passes/UnreachableEOGPass.kt 87.36% <86.76%> (-2.11%) ⬇️

... and 3 files with indirect coverage changes

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

@KuechA KuechA marked this pull request as ready for review February 4, 2025 13:01
Base automatically changed from ak/fixpointv2 to main February 5, 2025 10:54
Copy link
Collaborator

@konradweiss konradweiss left a comment

Choose a reason for hiding this comment

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

Generally the changes look adequate, but I noticed that some implementation may have missed in the old and new version.

when (val currentNode = currentEdge.end) {
is IfStatement -> {
handleIfStatement(currentEdge, currentNode, currentState)
newState = handleIfStatement(lattice, currentEdge, currentNode, newState)
Copy link
Collaborator

Choose a reason for hiding this comment

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

While looking through the code I noticed that we have this explicit handlers for IfStatement and WhileStatement, but not for the other branching Constructs. is that intentional? Are they not Needed for for, foreach, do and switch?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll double-check if some of these statements can be added. I think that some of these do not exist in the current implementation because the ValueEvaluator is still limited (this affects the foreach) and because I wasn't sure how to implement an appropriate comparison (this is the case for the switch).

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