Skip to content

Rework the call graph algorithm to annote call edges with the corresponding invoke statement#936

Merged
JonasKlauke merged 44 commits intodevelopfrom
feature/InvokesCG
Jul 25, 2024
Merged

Rework the call graph algorithm to annote call edges with the corresponding invoke statement#936
JonasKlauke merged 44 commits intodevelopfrom
feature/InvokesCG

Conversation

@JonasKlauke
Copy link
Copy Markdown
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
Copy Markdown
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

@github-actions
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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

# 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
@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

Development

Successfully merging this pull request may close these issues.

An inconsistency between call graphs Unexpected Clinit calls in the call graph Code line numbers in call-graphs.

3 participants