Skip to content

Commit 54bda3d

Browse files
committed
fixed the strong update problem for the backward analysis as well
1 parent c8c789d commit 54bda3d

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

soot-infoflow/src/soot/jimple/infoflow/problems/rules/backward/BackwardsStrongUpdatePropagationRule.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ public Collection<Abstraction> propagateNormalFlow(Abstraction d1, Abstraction s
7373
boolean addRightValue = false;
7474
boolean cutFirstField = false;
7575
Type type = null;
76+
boolean strongUpdate = true;
7677
if (source.getAccessPath().isInstanceFieldRef()) {
7778
// Data Propagation: x.f = y && x.f tainted --> y propagated
7879
if (leftOp instanceof InstanceFieldRef) {
@@ -113,13 +114,16 @@ else if (source.getAccessPath().isLocal() && leftOp instanceof Local) {
113114
addRightValue = true;
114115
type = ((ArrayType) ((ArrayRef) leftOp).getBase().getType()).getElementType();
115116
}
116-
} else if (aliasing.mustAlias((Local) leftOp, source.getAccessPath().getPlainValue(), stmt)) {
117-
addRightValue = true;
117+
} else if (leftOp instanceof Local) {
118+
if (aliasing.mustAlias((Local) leftOp, source.getAccessPath().getPlainValue(), stmt)) {
119+
addRightValue = true;
120+
strongUpdate = leftOp == source.getAccessPath().getPlainValue();
121+
}
118122
}
119123
}
120124

121125
if (addRightValue) {
122-
killSource.value = !(leftOp instanceof ArrayRef);
126+
killSource.value = !(leftOp instanceof ArrayRef) && strongUpdate;
123127

124128
Value rightOp = assignStmt.getRightOp();
125129
if (rightOp instanceof Constant || rightOp instanceof AnyNewExpr)

0 commit comments

Comments
 (0)