Skip to content

Commit 0b34ae1

Browse files
committed
try resolving method references in virtual dispatch into classes
1 parent eb595c5 commit 0b34ae1

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
import soot.SootField;
3232
import soot.SootFieldRef;
3333
import soot.SootMethod;
34+
import soot.SootMethodRef;
3435
import soot.Type;
3536
import soot.Unit;
3637
import soot.Value;
@@ -906,6 +907,15 @@ private Set<AccessPath> applyFlowsIterative(MethodSummaries flowsInCallee, List<
906907
// implementations in the application code
907908
if ((flowsInTarget == null || flowsInTarget.isEmpty()) && curGap != null) {
908909
SootMethod callee = Scene.v().grabMethod(curGap.getSignature());
910+
if (callee == null) {
911+
SootMethodAndClass smac = SootMethodRepresentationParser.v()
912+
.parseSootMethodString(curGap.getSignature());
913+
SootClass declClass = Scene.v().getSootClassUnsafe(smac.getClassName());
914+
if (declClass != null) {
915+
SootMethodRef ref = Scene.v().makeMethodRef(declClass, smac.getSubSignature(), false);
916+
callee = ref.tryResolve();
917+
}
918+
}
909919
if (callee != null) {
910920
for (SootMethod implementor : getImplementors(stmt, callee)) {
911921
Set<AccessPathPropagator> implementorPropagators = spawnAnalysisIntoClientCode(implementor,

0 commit comments

Comments
 (0)