|
48 | 48 | import soot.dexpler.typing.UntypedConstant; |
49 | 49 | import soot.jimple.ArrayRef; |
50 | 50 | import soot.jimple.AssignStmt; |
| 51 | +import soot.jimple.IdentityStmt; |
51 | 52 | import soot.jimple.InvokeExpr; |
52 | 53 | import soot.jimple.NewArrayExpr; |
| 54 | +import soot.jimple.ParameterRef; |
53 | 55 | import soot.toolkits.graph.ExceptionalUnitGraph; |
54 | 56 | import soot.toolkits.graph.ExceptionalUnitGraphFactory; |
55 | 57 | import soot.toolkits.scalar.LocalDefs; |
@@ -96,12 +98,12 @@ protected void internalTransform(final Body body, String phaseName, Map<String, |
96 | 98 | List<Type> arrayTypes = new LinkedList<>(); |
97 | 99 | checkArrayDefinitions(l, ass, defs, arrayTypes, MAX_RECURSION_DEPTH); |
98 | 100 | if (arrayTypes.isEmpty()) { |
99 | | - throw new InternalError("Failed to determine the array type "); |
| 101 | + throw new InternalError("Failed to determine the array type of " + l + " in method " + body.getMethod()); |
100 | 102 | } |
101 | 103 | if (arrayTypes.size() > 1) { |
102 | 104 | arrayTypes = arrayTypes.stream().distinct().collect(Collectors.toList()); |
103 | 105 | if (arrayTypes.size() > 1) { |
104 | | - logger.warn("Found multiple possible array types, using first ignoreing the others: {}", arrayTypes); |
| 106 | + logger.warn("Found multiple possible array types, using first ignoring the others: {}", arrayTypes); |
105 | 107 | } |
106 | 108 | } |
107 | 109 |
|
@@ -159,8 +161,11 @@ private void checkArrayDefinitions(Local l, Unit u, LocalDefs defs, List<Type> a |
159 | 161 | } else { |
160 | 162 | throw new InternalError("Unsupported array definition statement: " + d); |
161 | 163 | } |
| 164 | + } else if (d instanceof IdentityStmt) { |
| 165 | + IdentityStmt is = (IdentityStmt) d; |
| 166 | + ParameterRef pRef = (ParameterRef) is.getRightOpBox().getValue(); |
| 167 | + arrayTypes.add(((ArrayType) pRef.getType()).getArrayElementType()); |
162 | 168 | } |
163 | 169 | } |
164 | | - |
165 | 170 | } |
166 | 171 | } |
0 commit comments