From 47bdb8b2361083151a44ba76ee2f9f2dbd363b40 Mon Sep 17 00:00:00 2001 From: Tian Tan Date: Wed, 15 May 2024 14:13:46 +0800 Subject: [PATCH] Record context-sensitive variable (args) for processing reflective arguments --- .../pta/plugin/reflection/ReflectiveActionModel.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/main/java/pascal/taie/analysis/pta/plugin/reflection/ReflectiveActionModel.java b/src/main/java/pascal/taie/analysis/pta/plugin/reflection/ReflectiveActionModel.java index 572ed71b3..c3eec4147 100644 --- a/src/main/java/pascal/taie/analysis/pta/plugin/reflection/ReflectiveActionModel.java +++ b/src/main/java/pascal/taie/analysis/pta/plugin/reflection/ReflectiveActionModel.java @@ -91,7 +91,7 @@ public class ReflectiveActionModel extends AnalysisModelPlugin { /** * Associates argument variable (Object[]) to reflective call edges. */ - private final MultiMap reflectiveArgs = Maps.newMultiMap(); + private final MultiMap reflectiveArgs = Maps.newMultiMap(); /** * Set of invocations that are annotated by the reflection log. @@ -308,7 +308,7 @@ public void onNewCallEdge(Edge 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(); @@ -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 getAllTargets() {