fix(core): Fix passthrough and dataflow models handling - #385
Open
misonijnik wants to merge 7 commits into
Open
Conversation
(cherry picked from commit 1c4f415f421ca72cb5a350cae1ff673e6b34e4e1) (cherry picked from commit ab2b248be89187101031a493e07d4e57b1c28d48)
(cherry picked from commit a79998b2e4822dae3d765645a01bfb872cc36b6c) (cherry picked from commit ee5728a578231ee11446f0738283d1cd4fca8f03)
(cherry picked from commit ff74b11dd10e881af05b7182dace164a56724c4e) (cherry picked from commit 73cef33a76b39d90df2abda7c0c03c0b87e0c526)
(cherry picked from commit d096316bf5e6418e67acca21cea1b6a388c654e1) (cherry picked from commit c9544862ea3f5cd0eeab834a6628dac01df5a7b8)
A call through a functional interface resolves to both the interface method and the lambda body. Taint follows the lambda, so nothing is lost -- but the interface method was still recorded in dropped-external-methods.yaml, which is the worklist of methods that need a model. Function#apply and friends therefore showed up as high-call-site entries asking to be modelled, and a passthrough written for one would add a bogus arg-to-result edge to every lambda call in the program. Untrack the method when the call resolved to a concrete target and a lambda with no failures. Reduced from a commit that also permitted YAML anchors in rule-test manifests and stamped a dev version into Makefile builds; neither is needed.
approximationPriority called File(path).canonicalPath on every RegisteredLocation.
JavaRuntimeModuleLocation encodes module and java home into one string separated by
NUL ('use null symbol because it can't appear in any path'), so canonicalPath threw
IOException: Invalid file path once per JDK runtime module - 25 times per conductor
run - killing the indexer coroutine for each. Nondeterministic: runs either lost
runtime-module indexing silently or exited 0 with no report at all.
Guard it the way DataFlowApproximationLoader.normalizedPath already does.
(cherry picked from commit b57f73e9e4adfc49e2f9622be4a937906831b0db)
(cherry picked from commit e4bcd7d8dc7cced40e442ed3e32cb171fb00e2d1)
(cherry picked from commit bf28299)
The SAM fix was covered only by a mocked predicate check over two inputs, which could not detect the loss of either `any` clause, and untrackMethod -- the mechanism the fix depends on -- had no test at all. Add ExternalMethodTracker coverage for untracking, including the case that makes the fix work: erasing a record the tracker already holds from an earlier call site, not merely suppressing later ones. Extend the predicate cases to concrete-only, lambda-only, empty, and failure-only, so dropping either `any` clause now fails a test. (cherry picked from commit 18ac6f9)
This file contains hidden or 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
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.
No description provided.