Skip to content

Commit 39da71e

Browse files
committed
Ignore Arrays.copyOf() for PTA Solver to address precision degradation
1 parent 86ef02d commit 39da71e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/main/java/pascal/taie/analysis/pta/plugin/natives/ArrayModel.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,13 @@ public static class AnalysisModel extends AnalysisModelPlugin {
5757
super(solver);
5858
}
5959

60+
@Override
61+
public void onStart() {
62+
// Solver should ignore `Arrays.copyOf()` to avoid spurious flows merging from other
63+
// callsites, as in the `IRModelPlugin.onStart()`.
64+
handlers.keySet().forEach(solver::addIgnoredMethod);
65+
}
66+
6067
@InvokeHandler(signature = "<java.util.Arrays: java.lang.Object[] copyOf(java.lang.Object[],int)>", argIndexes = {0})
6168
public void arraysCopyOf(Context context, Invoke invoke, PointsToSet from) {
6269
JMethod container = invoke.getContainer();

0 commit comments

Comments
 (0)