Skip to content

Commit ed08a2c

Browse files
authored
Merge pull request #848 from MarcMil/extensible
Fix searching for static methods & NPE
2 parents 9e97b89 + 195949a commit ed08a2c

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

soot-infoflow/src/soot/jimple/infoflow/codeOptimization/InterproceduralConstantValuePropagator.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -834,7 +834,8 @@ private void propagateConstantsIntoCallee(SootMethod sm) {
834834
if (excludedMethods != null && icfg.isReachable(callSite)) {
835835
SootMethod caller = icfg.getMethodOf(callSite);
836836
// synthetic methods e.g. created by FlowDroid are excluded by default
837-
if (excludedMethods.contains(caller) || caller.hasTag(SimulatedCodeElementTag.TAG_NAME)) {
837+
if (caller == null || excludedMethods.contains(caller)
838+
|| caller.hasTag(SimulatedCodeElementTag.TAG_NAME)) {
838839
logger.trace("Ignoring calls from {}", caller);
839840
continue;
840841
}

soot-infoflow/src/soot/jimple/infoflow/util/SootUtils.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,13 @@ public static List<Value> getUseAndDefValues(Unit u) {
4444
*/
4545
public static SootMethod findMethod(SootClass currentClass, String subsignature) {
4646
Scene sc = Scene.v();
47-
return sc.getOrMakeFastHierarchy().resolveMethod(currentClass,
47+
SootMethod m = sc.getOrMakeFastHierarchy().resolveMethod(currentClass,
4848
sc.makeMethodRef(currentClass, subsignature, false), true);
49+
if (m == null) {
50+
//maybe the method is static
51+
m = currentClass.getMethodUnsafe(subsignature);
52+
}
53+
return m;
4954
}
5055

5156
}

0 commit comments

Comments
 (0)