Skip to content
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

Merged
merged 44 commits into from
Jul 25, 2024

Conversation

JonasKlauke
Copy link
Collaborator

@JonasKlauke JonasKlauke commented May 17, 2024

  1. 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
  2. moves clinit invokes from the constructor invoke to corresponding new statements before the call, to support clinit calls caused by arrays or multiarrys
  3. call graphs will save a list entry methods
  4. clinit calls of given start methods are added to the entry methods of a call graphs
  5. the edge between a starting method and their corresponding clinit method was removed fixes Unexpected Clinit calls in the call graph #902
  6. added test for bug report An inconsistency between call graphs #903, fixes An inconsistency between call graphs #903

@JonasKlauke
Copy link
Collaborator Author

entry methods wont contain anymore an edge to the clinit method.
clinit methods will be added as new entry points to the call graph.
fixes #902

Copy link
Contributor

github-actions bot commented May 17, 2024

Documentation Preview.

@JonasKlauke JonasKlauke marked this pull request as ready for review May 24, 2024 14:13
@JonasKlauke JonasKlauke requested a review from swissiety May 24, 2024 14:20
Copy link
Collaborator

@swissiety swissiety left a 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.

}

@Override
public FlowFunction<Value> getCallToReturnFlowFunction(Stmt callSite, Stmt returnSite) {
return getCallToReturnFlow(callSite, returnSite);
return getCallToReturnFlow((InvokableStmt) callSite, returnSite);
Copy link
Collaborator

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?

Copy link
Collaborator Author

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?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I created #937

sootup.core/src/main/java/sootup/core/types/ArrayType.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
@JonasKlauke JonasKlauke merged commit 3a03fa0 into develop Jul 25, 2024
8 checks passed
@JonasKlauke JonasKlauke deleted the feature/InvokesCG branch July 25, 2024 13:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants