-
Notifications
You must be signed in to change notification settings - Fork 62
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
Abstract Value Analysis #1759
Open
CodingDepot
wants to merge
61
commits into
main
Choose a base branch
from
rh/abstract-value-analysis
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Abstract Value Analysis #1759
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
commit 5c20b05 Author: Robert Haimerl <robert.haimerl@aisec.fraunhofer.de> Date: Wed Oct 16 13:25:06 2024 +0200 fix breaking merge changes commit cc8eb48 Merge: 3e3c094 344ea58 Author: Robert Haimerl <robert.haimerl@aisec.fraunhofer.de> Date: Wed Oct 16 13:08:46 2024 +0200 Merge branch 'rh/abstract-value-analysis' into rh/abstract-value-analysis-worklist # Conflicts: # cpg-analysis/src/main/kotlin/de/fraunhofer/aisec/cpg/analysis/abstracteval/AbstractEvaluator.kt # cpg-core/src/main/kotlin/de/fraunhofer/aisec/cpg/helpers/EOGWorklist.kt commit 3e3c094 Author: Robert Haimerl <robert.haimerl@aisec.fraunhofer.de> Date: Wed Oct 16 13:04:45 2024 +0200 remove redundant pushes to the worklist itself commit 6d731f2 Author: Robert Haimerl <robert.haimerl@aisec.fraunhofer.de> Date: Wed Oct 16 13:04:21 2024 +0200 override methods to use custom functionality in IntervalStates commit 1eb5a51 Author: Robert Haimerl <robert.haimerl@aisec.fraunhofer.de> Date: Wed Oct 16 13:03:57 2024 +0200 enhance analysis for simple value operations commit 108f374 Author: Robert Haimerl <robert.haimerl@aisec.fraunhofer.de> Date: Wed Oct 16 09:56:22 2024 +0200 join intervals for multiple EOG (branch joins) commit d4383b4 Author: Robert Haimerl <robert.haimerl@aisec.fraunhofer.de> Date: Wed Oct 16 09:33:41 2024 +0200 revert the change to the worklist pop to make it FIFO again commit 46798c5 Author: Robert Haimerl <robert.haimerl@aisec.fraunhofer.de> Date: Wed Oct 16 09:33:23 2024 +0200 return a new altered state instead of directly modifying the current state commit c634646 Author: Robert Haimerl <robert.haimerl@aisec.fraunhofer.de> Date: Mon Oct 14 13:12:46 2024 +0200 remove getInitialRange from the evaluator commit f984a2c Author: Robert Haimerl <robert.haimerl@aisec.fraunhofer.de> Date: Mon Oct 14 13:11:58 2024 +0200 remove the "getInitialRange" method for values and instead mark declarations as operations with effect commit beb4d38 Author: Robert Haimerl <robert.haimerl@aisec.fraunhofer.de> Date: Mon Oct 14 12:26:22 2024 +0200 simplify evaluator to only use one worklist without special handling for loops and branches commit 6ec77dc Author: Robert Haimerl <robert.haimerl@aisec.fraunhofer.de> Date: Mon Oct 14 12:25:04 2024 +0200 add "until" to iteration, add state information to Worklist, fix pop order commit 253debb Author: Robert Haimerl <robert.haimerl@aisec.fraunhofer.de> Date: Mon Oct 14 12:23:17 2024 +0200 remove all modes from the IntervalState commit 31ca4ac Author: Robert Haimerl <robert.haimerl@aisec.fraunhofer.de> Date: Mon Oct 14 12:17:45 2024 +0200 remove boolean information about whether the operation had an impact commit ccd839e Author: Robert Haimerl <robert.haimerl@aisec.fraunhofer.de> Date: Mon Oct 14 09:17:11 2024 +0200 add three different state modes commit e0e1a28 Author: Robert Haimerl <robert.haimerl@aisec.fraunhofer.de> Date: Mon Oct 7 12:08:52 2024 +0200 rewrite the handleBranch branch commit 672f27f Author: Robert Haimerl <robert.haimerl@aisec.fraunhofer.de> Date: Mon Oct 7 11:45:10 2024 +0200 rewrite the handleLoop branch commit 33f3531 Author: Robert Haimerl <robert.haimerl@aisec.fraunhofer.de> Date: Mon Oct 7 10:54:15 2024 +0200 rewrite the applyEffect branch commit ca88bb7 Author: Robert Haimerl <robert.haimerl@aisec.fraunhofer.de> Date: Mon Oct 7 10:20:39 2024 +0200 rewrite evaluate function to use "iterateEOG"
…eady propagated from predecessors
…an the upper bound
…r now handles the order
oxisto
reviewed
Nov 11, 2024
cpg-analysis/src/main/kotlin/de/fraunhofer/aisec/cpg/analysis/abstracteval/value/Array.kt
Outdated
Show resolved
Hide resolved
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR tracks the implementation of an improved abstract value analysis.
The evaluator aims to determine possible values of a given variable at the specified node by considering all changes made to it starting from its initialization.
It aims to support multiple different types of values including simple number values as well as the length of collections. For this, the supported values need to define themselves which operations performed on them affect their possible value range.
The end result is an interval spanning the range of possible values for the variable at the specified node.
The initial PR focuses on Integer evaluation, but it can be easily extended to support other cases.
Open Work:
Moved out of scope for the initial PR
Pre-Evaluate conditions for better performance and resultAdd additional supported Values