Skip to content

Commit 7243cea

Browse files
committed
Fix CHABuilder method resolution for static and special methods
1 parent 7caca0a commit 7243cea

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/main/java/pascal/taie/analysis/graph/callgraph/CHABuilder.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,9 +176,12 @@ private Set<JMethod> resolveCalleesOf(Invoke callSite) {
176176
}
177177
yield callees.size() <= calleeLimit ? callees : Set.of();
178178
}
179-
case SPECIAL, STATIC -> Set.of(callSite.getMethodRef().resolve());
179+
case SPECIAL, STATIC -> {
180+
JMethod callee = callSite.getMethodRef().resolveNullable();
181+
yield callee == null ? Set.of() : Set.of(callee);
182+
}
180183
case DYNAMIC -> {
181-
logger.debug("CHA cannot resolve invokedynamic {}", callSite);
184+
logger.warn("CHA cannot resolve invokedynamic {}", callSite);
182185
yield Set.of();
183186
}
184187
default -> throw new AnalysisException(

0 commit comments

Comments
 (0)