Skip to content

Commit

Permalink
Record context-sensitive variable (args) for processing reflective ar…
Browse files Browse the repository at this point in the history
…guments
  • Loading branch information
silverbullettt committed May 15, 2024
1 parent 9f92137 commit 47bdb8b
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public class ReflectiveActionModel extends AnalysisModelPlugin {
/**
* Associates argument variable (Object[]) to reflective call edges.
*/
private final MultiMap<Var, ReflectiveCallEdge> reflectiveArgs = Maps.newMultiMap();
private final MultiMap<CSVar, ReflectiveCallEdge> reflectiveArgs = Maps.newMultiMap();

/**
* Set of invocations that are annotated by the reflection log.
Expand Down Expand Up @@ -308,7 +308,7 @@ public void onNewCallEdge(Edge<CSCallSite, CSMethod> edge) {
CSVar csArgs = csManager.getCSVar(callerCtx, args);
passReflectiveArgs(refEdge, solver.getPointsToSetOf(csArgs));
// record args for later-arrive array objects
reflectiveArgs.put(args, refEdge);
reflectiveArgs.put(csArgs, refEdge);
}
// pass return value
Invoke invoke = refEdge.getCallSite().getCallSite();
Expand Down Expand Up @@ -349,8 +349,7 @@ private static boolean isConcerned(Type type) {
@Override
public void onNewPointsToSet(CSVar csVar, PointsToSet pts) {
super.onNewPointsToSet(csVar, pts);
reflectiveArgs.get(csVar.getVar())
.forEach(edge -> passReflectiveArgs(edge, pts));
reflectiveArgs.get(csVar).forEach(edge -> passReflectiveArgs(edge, pts));
}

MultiMap<Invoke, Object> getAllTargets() {
Expand Down

0 comments on commit 47bdb8b

Please sign in to comment.