Skip to content

Disable ReflectionAllocationsAnalysis for TypeBasedPointsTo key#367

Open
johannesduesing wants to merge 2 commits into
developfrom
bugfix/reflection-allocations-analysis
Open

Disable ReflectionAllocationsAnalysis for TypeBasedPointsTo key#367
johannesduesing wants to merge 2 commits into
developfrom
bugfix/reflection-allocations-analysis

Conversation

@johannesduesing

Copy link
Copy Markdown
Collaborator

As mentioned in #357 the ReflectionAllocationsAnalysisScheduler should not be executed with the TypeBasedPointsToCallGraphKey, but it should be run for all other implementations of PointsToCallGraphKey. This PR proposes one possible solution for the issue - i am however open for discussion, there are many ways this could be realized.

This PR moves the ReflectionAllocationsAnalysisScheduler into a separate configuration section, which is not loaded by the PointsToCallGraphKey trait, but instead by the new and more specific trait AllocationSiteBasedPointsToCallGraphKey extends PointsToCallGraphKey. The TypeBasedPointsToCallGraphKey only implements PointsToCallGraphKey, so the incompatible analysis is not loaded. I made all other direct children of PointsToCallGraphKey inherit from AllocationSiteBasedPointsToCallGraphKey instead, so they all still load the desired analysis.

@johannesduesing johannesduesing requested a review from errt July 7, 2026 12:14
@johannesduesing johannesduesing self-assigned this Jul 7, 2026
@johannesduesing johannesduesing added the bug Something isn't working label Jul 7, 2026
@johannesduesing johannesduesing linked an issue Jul 7, 2026 that may be closed by this pull request
@errt

errt commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

Looks good to me.

I wonder whether we should rename the ReflectionAllocationsAnalysisScheduler to be compatible with getModuleFQN though.

@johannesduesing

Copy link
Copy Markdown
Collaborator Author

I think that's fair, i can implement that. However i'm just now wondering: The CFA_1_0_CallGraphKey also has pointsToType = "TypeBased" - should it be using the ReflectionAllocationAnalysisScheduler at all, or are they also incompatible?

@errt

errt commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator

None of the type-based points-to analyses (including 1-0-CFA) can use the allocation information. Though we could check whether it is useful to extend the analysis to provide type-based points-to sets for these.

@johannesduesing

Copy link
Copy Markdown
Collaborator Author

Maybe we need two analyses then, with the correct one being loaded via getModuleFQN .... I'll have a look into that!

@errt

errt commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator

Our points-to analyses are flexible enough to handle such cases with one analysis (and two schedulers), but I'm not sure whether such an analysis is any useful for type-based points-to analysis or not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix Usage of ReflectionAllocations Analysis

2 participants