Skip to content

Commit 73ded82

Browse files
committed
Make Zero Access Path available
1 parent 4c25e4f commit 73ded82

File tree

1 file changed

+15
-9
lines changed

1 file changed

+15
-9
lines changed

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

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,12 @@
1313
import java.util.Arrays;
1414

1515
import com.google.common.base.Joiner;
16-
import soot.*;
16+
17+
import soot.Local;
18+
import soot.NullType;
19+
import soot.SootField;
20+
import soot.Type;
21+
import soot.Value;
1722
import soot.jimple.ArrayRef;
1823
import soot.jimple.InstanceFieldRef;
1924
import soot.jimple.Jimple;
@@ -66,18 +71,18 @@ private AccessPath() {
6671

6772
AccessPath(Local val, SootField[] appendingFields, Type valType, Type[] appendingFieldTypes, boolean taintSubFields,
6873
boolean isCutOffApproximation, ArrayTaintType arrayTaintType, boolean canHaveImmutableAliases) {
69-
this(val, valType, null,
70-
AccessPathFragment.createFragmentArray(appendingFields, appendingFieldTypes, null),
71-
taintSubFields, isCutOffApproximation, arrayTaintType, canHaveImmutableAliases);
74+
this(val, valType, null, AccessPathFragment.createFragmentArray(appendingFields, appendingFieldTypes, null),
75+
taintSubFields, isCutOffApproximation, arrayTaintType, canHaveImmutableAliases);
7276
}
7377

7478
AccessPath(Local val, Type valType, AccessPathFragment[] fragments, boolean taintSubFields,
7579
boolean isCutOffApproximation, ArrayTaintType arrayTaintType, boolean canHaveImmutableAliases) {
76-
this(val, valType, null, fragments, taintSubFields, isCutOffApproximation, arrayTaintType, canHaveImmutableAliases);
80+
this(val, valType, null, fragments, taintSubFields, isCutOffApproximation, arrayTaintType,
81+
canHaveImmutableAliases);
7782
}
7883

7984
AccessPath(Local val, Type valType, ContainerContext[] ctxt, AccessPathFragment[] fragments, boolean taintSubFields,
80-
boolean isCutOffApproximation, ArrayTaintType arrayTaintType, boolean canHaveImmutableAliases) {
85+
boolean isCutOffApproximation, ArrayTaintType arrayTaintType, boolean canHaveImmutableAliases) {
8186
this.value = val;
8287
this.baseType = valType;
8388
this.baseContext = ctxt;
@@ -238,6 +243,7 @@ public int hashCode() {
238243
}
239244

240245
private int hashCodeWOContext = 0;
246+
241247
public int hashCodeWithoutContext() {
242248
if (hashCodeWOContext != 0)
243249
return hashCodeWOContext;
@@ -311,7 +317,8 @@ public boolean equalsWithoutContext(Object obj) {
311317

312318
AccessPath other = (AccessPath) obj;
313319

314-
if (this.hashCodeWOContext != 0 && other.hashCodeWOContext != 0 && this.hashCodeWOContext != other.hashCodeWOContext)
320+
if (this.hashCodeWOContext != 0 && other.hashCodeWOContext != 0
321+
&& this.hashCodeWOContext != other.hashCodeWOContext)
315322
return false;
316323

317324
if (value == null) {
@@ -500,7 +507,6 @@ public ContainerContext[] getBaseContext() {
500507
return this.baseContext;
501508
}
502509

503-
504510
/**
505511
* Gets whether sub-fields shall be tainted. If this access path is e.g. a.b.*,
506512
* the result is true, whereas it is false for a.b.
@@ -573,7 +579,7 @@ public boolean getCanHaveImmutableAliases() {
573579
*
574580
* @return The access path that is used in the zero abstraction
575581
*/
576-
static AccessPath getZeroAccessPath() {
582+
public static AccessPath getZeroAccessPath() {
577583
if (zeroAccessPath == null)
578584
zeroAccessPath = new AccessPath(Jimple.v().newLocal("zero", NullType.v()), null, NullType.v(), null, false,
579585
false, ArrayTaintType.ContentsAndLength, false);

0 commit comments

Comments
 (0)