Skip to content

Commit 67646e1

Browse files
committed
Follow-up on type refinement on arrays
1 parent 39bbbae commit 67646e1

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

soot-infoflow-summaries/src/soot/jimple/infoflow/methodSummary/taintWrappers/SummaryTaintWrapper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1720,7 +1720,7 @@ protected Taint addSinkTaint(MethodFlow flow, Taint taint, GapDefinition gap, St
17201720
String sBaseType = sinkType == null ? null : "" + sinkType;
17211721
if (!flow.getIgnoreTypes()) {
17221722
// Compute the new base type
1723-
Type newBaseType = manager.getTypeUtils().getMorePreciseType(taintType, sinkType);
1723+
Type newBaseType = manager.getTypeUtils().getMorePreciseType(sinkType, taintType);
17241724
if (newBaseType == null)
17251725
newBaseType = sinkType;
17261726

soot-infoflow-summaries/summariesManual/java.util.Collection.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
ImplicitLocation="Next" />
1111
</constraints>
1212
<flows>
13-
<flow isAlias="true" typeChecking="false" final="true">
13+
<flow isAlias="withContext" typeChecking="false" final="true">
1414
<from sourceSinkType="Parameter" ParameterIndex="0" />
1515
<to sourceSinkType="Field"
1616
AccessPath="[java.util.Collection: java.lang.Object[] innerArray]"

soot-infoflow/src/soot/jimple/infoflow/typing/TypeUtils.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -226,18 +226,18 @@ else if (fastHierarchy.canStoreType(declType, possibleRefinement))
226226
// If one type is an array type and the other one is the base type,
227227
// we still accept the cast
228228
if (declType instanceof ArrayType && possibleRefinement instanceof ArrayType) {
229-
ArrayType at1 = (ArrayType) declType;
230-
ArrayType at2 = (ArrayType) possibleRefinement;
229+
ArrayType at1 = (ArrayType) possibleRefinement;
230+
ArrayType at2 = (ArrayType) declType;
231231
if (at1.numDimensions != at2.numDimensions)
232232
return null;
233233
Type preciseType = getMorePreciseType(at1.getElementType(), at2.getElementType());
234234
if (preciseType == null)
235235
return null;
236236

237-
return ArrayType.v(preciseType, at1.numDimensions);
237+
return ArrayType.v(preciseType, at2.numDimensions);
238238
} else if (declType instanceof ArrayType) {
239239
ArrayType at = (ArrayType) declType;
240-
Type preciseType = getMorePreciseType(at.getElementType(), possibleRefinement);
240+
Type preciseType = getMorePreciseType(possibleRefinement, at.getElementType());
241241
if (preciseType == null)
242242
return null;
243243

0 commit comments

Comments
 (0)