Skip to content

Commit

Permalink
Address #108 (comment).
Browse files Browse the repository at this point in the history
  • Loading branch information
khatchad committed Dec 1, 2023
1 parent 98b0b79 commit cd48f40
Showing 1 changed file with 1 addition and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ protected void processCallingConstraints(
// If we are looking at the implicit parameter of a callable.
if (call.getCallSite().isDispatch() && i == 0 && isCallable(rval)) {
// Ensure that lval's variable refers to the callable method instead of callable object.
IClass callable = getCallable(target);
IClass callable = target.getMethod().getDeclaringClass();
IntSet instanceKeysForCallable = this.getSystem().getInstanceKeysForClass(callable);

for (IntIterator it = instanceKeysForCallable.intIterator(); it.hasNext(); ) {
Expand Down Expand Up @@ -292,18 +292,6 @@ protected void processCallingConstraints(
}
}

private IClass getCallable(CGNode target) {
IMethod method = target.getMethod();
IClass declaringClass = method.getDeclaringClass();
TypeName declaringClassName = declaringClass.getName();

TypeReference typeReference =
TypeReference.findOrCreate(
declaringClass.getClassLoader().getReference(), declaringClassName);

return this.getClassHierarchy().lookupClass(typeReference);
}

protected boolean isCallable(PointerKey rval) {
PointerAnalysis<InstanceKey> pointerAnalysis = this.getPointerAnalysis();
OrdinalSet<InstanceKey> pointsToSet = pointerAnalysis.getPointsToSet(rval);
Expand Down

0 comments on commit cd48f40

Please sign in to comment.