Skip to content

Commit b425eb4

Browse files
committed
Fix a bug where due to an optimization the computed path would be incorrect
1 parent 4a4d95c commit b425eb4

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

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/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)