Skip to content

fix(core): Fix passthrough and dataflow models handling - #385

Open
misonijnik wants to merge 7 commits into
mainfrom
misonijnik/approximation-fixes-on-main
Open

fix(core): Fix passthrough and dataflow models handling#385
misonijnik wants to merge 7 commits into
mainfrom
misonijnik/approximation-fixes-on-main

Conversation

@misonijnik

Copy link
Copy Markdown
Member

No description provided.

(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)
@misonijnik
misonijnik requested a review from Saloed August 27, 2026 06:03
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.

1 participant