Skip to content

Commit 01bf3b2

Browse files
authored
Merge pull request #704 from MarcMil/extensibility
Fix a bug where the path could miss statements
2 parents 2d75774 + 5b193af commit 01bf3b2

File tree

10 files changed

+23
-15
lines changed

10 files changed

+23
-15
lines changed

soot-infoflow/src/soot/jimple/infoflow/AbstractInfoflow.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1095,7 +1095,7 @@ else if (reason instanceof TimeoutReason)
10951095
// After the last intermediate result has been computed,
10961096
// we need to re-process those abstractions that
10971097
// received new neighbors in the meantime
1098-
builder.runIncrementalPathCompuation();
1098+
builder.runIncrementalPathComputation();
10991099

11001100
try {
11011101
resultExecutor.awaitCompletion();

soot-infoflow/src/soot/jimple/infoflow/data/Abstraction.java

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -168,12 +168,11 @@ public Abstraction deriveNewAbstraction(AccessPath p, Stmt currentStmt) {
168168
return deriveNewAbstraction(p, currentStmt, isImplicit);
169169
}
170170

171-
public Abstraction deriveNewAbstraction(AccessPath p, Stmt currentStmt, boolean isImplicit) {
172-
// If the new abstraction looks exactly like the current one, there is
173-
// no need to create a new object
174-
if (this.accessPath.equals(p) && this.currentStmt == currentStmt && this.isImplicit == isImplicit)
175-
return this;
171+
public Abstraction deriveDefinitelyNewAbstraction(AccessPath p, Stmt currentStmt) {
172+
return deriveDefinitelyNewAbstraction(p, currentStmt, isImplicit);
173+
}
176174

175+
public Abstraction deriveDefinitelyNewAbstraction(AccessPath p, Stmt currentStmt, boolean isImplicit) {
177176
Abstraction abs = deriveNewAbstractionMutable(p, currentStmt);
178177
if (abs == null)
179178
return null;
@@ -182,6 +181,15 @@ public Abstraction deriveNewAbstraction(AccessPath p, Stmt currentStmt, boolean
182181
return abs;
183182
}
184183

184+
public Abstraction deriveNewAbstraction(AccessPath p, Stmt currentStmt, boolean isImplicit) {
185+
// If the new abstraction looks exactly like the current one, there is
186+
// no need to create a new object
187+
if (this.accessPath.equals(p) && this.currentStmt == currentStmt && this.isImplicit == isImplicit)
188+
return this;
189+
190+
return deriveDefinitelyNewAbstraction(p, currentStmt, isImplicit);
191+
}
192+
185193
protected Abstraction deriveNewAbstractionMutable(AccessPath p, Stmt currentStmt) {
186194
// An abstraction needs an access path
187195
if (p == null)

soot-infoflow/src/soot/jimple/infoflow/data/pathBuilders/BatchPathBuilder.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ public InfoflowResults getResults() {
8181
}
8282

8383
@Override
84-
public void runIncrementalPathCompuation() {
85-
innerBuilder.runIncrementalPathCompuation();
84+
public void runIncrementalPathComputation() {
85+
innerBuilder.runIncrementalPathComputation();
8686
}
8787

8888
@Override

soot-infoflow/src/soot/jimple/infoflow/data/pathBuilders/ContextInsensitivePathBuilder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ protected boolean triggerComputationForNeighbors() {
152152
}
153153

154154
@Override
155-
public void runIncrementalPathCompuation() {
155+
public void runIncrementalPathComputation() {
156156
Set<AbstractionAtSink> incrementalAbs = new HashSet<>();
157157
for (Abstraction abs : pathCache.keySet())
158158
for (SourceContextAndPath scap : pathCache.get(abs)) {

soot-infoflow/src/soot/jimple/infoflow/data/pathBuilders/ContextInsensitiveSourceFinder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ protected Runnable getTaintPathTask(AbstractionAtSink abs) {
108108
}
109109

110110
@Override
111-
public void runIncrementalPathCompuation() {
111+
public void runIncrementalPathComputation() {
112112
// not implemented
113113
}
114114

soot-infoflow/src/soot/jimple/infoflow/data/pathBuilders/ContextSensitivePathBuilder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ protected boolean checkForSource(Abstraction abs, SourceContextAndPath scap) {
244244
}
245245

246246
@Override
247-
public void runIncrementalPathCompuation() {
247+
public void runIncrementalPathComputation() {
248248
Set<AbstractionAtSink> incrementalAbs = new HashSet<>();
249249
for (Abstraction abs : pathCache.keySet())
250250
for (SourceContextAndPath scap : pathCache.get(abs)) {

soot-infoflow/src/soot/jimple/infoflow/data/pathBuilders/EmptyPathBuilder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public void addResultAvailableHandler(OnPathBuilderResultAvailable handler) {
2828
}
2929

3030
@Override
31-
public void runIncrementalPathCompuation() {
31+
public void runIncrementalPathComputation() {
3232
}
3333

3434
@Override

soot-infoflow/src/soot/jimple/infoflow/data/pathBuilders/IAbstractionPathBuilder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,6 @@ public interface OnPathBuilderResultAvailable {
5656
* computed. This method is usually called after the taint propagation has
5757
* finished when incremental path building has been used in between.
5858
*/
59-
public void runIncrementalPathCompuation();
59+
public void runIncrementalPathComputation();
6060

6161
}

soot-infoflow/src/soot/jimple/infoflow/data/pathBuilders/RecursivePathBuilder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ public InfoflowResults getResults() {
174174
}
175175

176176
@Override
177-
public void runIncrementalPathCompuation() {
177+
public void runIncrementalPathComputation() {
178178
// not implemented
179179
}
180180

soot-infoflow/src/soot/jimple/infoflow/problems/TaintPropagationResults.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public boolean addResult(AbstractionAtSink resultAbs) {
6363

6464
// Construct the abstraction at the sink
6565
Abstraction abs = resultAbs.getAbstraction();
66-
abs = abs.deriveNewAbstraction(abs.getAccessPath(), resultAbs.getSinkStmt());
66+
abs = abs.deriveDefinitelyNewAbstraction(abs.getAccessPath(), resultAbs.getSinkStmt());
6767
abs.setCorrespondingCallSite(resultAbs.getSinkStmt());
6868

6969
// Reduce the incoming abstraction

0 commit comments

Comments
 (0)