Skip to content

Commit 6abe316

Browse files
committed
Don't handover on overwrites
1 parent 1a58260 commit 6abe316

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,9 @@ else if (source.dependsOnCutAP() || isCircularType(leftVal)) {
162162
}
163163
}
164164
} else if (leftVal == sourceBase) {
165-
handoverLeftValue = true;
165+
// Either the alias is overwritten here or a write to an array element
166+
handoverLeftValue = leftOp instanceof ArrayRef;
167+
leftSideOverwritten = !handoverLeftValue;
166168
}
167169

168170
if (handoverLeftValue) {
@@ -171,8 +173,6 @@ else if (source.dependsOnCutAP() || isCircularType(leftVal)) {
171173
handOver(d1, srcUnit, source);
172174
}
173175

174-
leftSideOverwritten = !(leftOp instanceof ArrayRef) && !(leftOp instanceof FieldRef)
175-
&& Aliasing.baseMatches(leftOp, source);
176176
if (leftSideOverwritten)
177177
return null;
178178
res.add(source);

0 commit comments

Comments
 (0)