-
-
Notifications
You must be signed in to change notification settings - Fork 83
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
Rework the call graph algorithm to annote call edges with the corresponding invoke statement #936
Conversation
JonasKlauke
commented
May 17, 2024
•
edited
Loading
edited
- introduces Invokable Statements on edges of the call graph to know the target of a specific invokable statement. closes Code line numbers in call-graphs. #483
- moves clinit invokes from the constructor invoke to corresponding new statements before the call, to support clinit calls caused by arrays or multiarrys
- call graphs will save a list entry methods
- clinit calls of given start methods are added to the entry methods of a call graphs
- the edge between a starting method and their corresponding clinit method was removed fixes Unexpected Clinit calls in the call graph #902
- added test for bug report An inconsistency between call graphs #903, fixes An inconsistency between call graphs #903
…e target of a specific invokable statement
entry methods wont contain anymore an edge to the clinit method. |
…ement to support newarray and newmultiarray
…newarray or newmultiarray expression
…e call graph. Added a test for multiple calling sides of same methods
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 not sure about introducing all these TestUtil classes - Currently it seems/feels like it is creating a lot of additional clutter which does make understanding tests more complicated.. maybe we can reiterate that and have a look how other projects solve it, especially as of the current implementation we can't share those classes across the submodules and would have code duplicates.
sootup.analysis/src/main/java/sootup/analysis/interprocedural/icfg/CGEdgeUtil.java
Outdated
Show resolved
Hide resolved
} | ||
|
||
@Override | ||
public FlowFunction<Value> getCallToReturnFlowFunction(Stmt callSite, Stmt returnSite) { | ||
return getCallToReturnFlow(callSite, returnSite); | ||
return getCallToReturnFlow((InvokableStmt) callSite, returnSite); |
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.
can we adapt heros to have different generic types for callSite Stmts and the other Stmts?
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 did not touch the analysis stuff. I made it only work for the current state. I will add an issue for the complete adaption. Or should this PR also contain the adaption to analysis?
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 created #937
sootup.callgraph/src/main/java/sootup/callgraph/AbstractCallGraphAlgorithm.java
Show resolved
Hide resolved
sootup.callgraph/src/main/java/sootup/callgraph/AbstractCallGraphAlgorithm.java
Outdated
Show resolved
Hide resolved
sootup.callgraph/src/main/java/sootup/callgraph/AbstractCallGraphAlgorithm.java
Outdated
Show resolved
Hide resolved
sootup.core/src/main/java/sootup/core/jimple/common/stmt/InvokableStmt.java
Outdated
Show resolved
Hide resolved
# Conflicts: # sootup.callgraph/src/main/java/sootup/callgraph/AbstractCallGraphAlgorithm.java # sootup.callgraph/src/main/java/sootup/callgraph/RapidTypeAnalysisAlgorithm.java # sootup.tests/src/test/java/sootup/tests/CallGraphTest.java
# Conflicts: # sootup.callgraph/src/main/java/sootup/callgraph/RapidTypeAnalysisAlgorithm.java # sootup.core/src/main/java/sootup/core/jimple/common/expr/JNewMultiArrayExpr.java # sootup.tests/pom.xml
sootup.core/src/main/java/sootup/core/jimple/common/stmt/InvokableStmt.java
Show resolved
Hide resolved
# Conflicts: # sootup.callgraph/src/main/java/sootup/callgraph/CallGraph.java