-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deal with multiple possible callables #208
Conversation
* Return `null` when there are multiple possible callables. * Add test to exercise call string imprecision. Based on the call string length. See wala/WALA#1417 (reply in thread). * Expect the test to fail. In the past, we could add 0's to the parameters, but since we are not enforcing the existing of the node in the CG, we can no longer do that. Still, this test should now fail if wala#207 is fixed.
We don't the instance key that produces the callable right now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm having trouble following the overall flow here. It seems the method trampoline target selector looks at points-to sets to figure out a receiver, and then somewhere this receiver is passed to the superclass target selector. This doesn't fit my standard model of how things work. I would expect the pointer analysis to be iterating through possible receiver objects and then calling into the target selector to get the target (possibly null
) for each one. Do you understand how this all fits together, and if so, could you explain it a bit?
That is sort of what happens, except that we don't call into a target selector. First, we detect whether the given receiver is a "callable" object: Line 90 in b8eccd0
Then, we swap the receiver: Lines 95 to 96 in b8eccd0
The new receiver will actually represent the callable method: Lines 209 to 218 in b8eccd0
The points-to set iteration happens here: Lines 221 to 240 in b8eccd0
That is where we find the |
Thanks, but I'm wondering, where is the target selector for call graph construction getting called in the first place? That's the place where I would expect the points-to set iteration to be happening. Like here is code in the WALA Java bytecode analysis: The flow is a little complex, but basically it gets the receiver type from an instance key, and only then calls into the MethodTargetSelector (gets called in |
Ariadne also has this as the starting point for getting the target selector for call graph construction.
I see what you mean. So, instead of swapping the receiver inside the instance method trampoline target selector, we'd swap the receiver at the caller further up the call stack. I think that would work also. I think a bigger issue perhaps is #207, i.e., I'm unsure whether using the points-to analysis in the first place is the right way to go. Does #207 make sense? Otherwise, I don't see why we can't move the points-to set iteration. |
Ok, unfortunately I don't have time to dig deep here to understand what is going on. Something does seem off. For now, maybe you can add a TODO comment in the code linking #207 and saying we need a deeper investigation to at least document how this is working? I don't want to block you so we can go ahead and land this PR once we have that. |
Yes, also short on time here. To summarize:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved but please add discussed code comment before merging
null
when there are multiple possible callables.