Skip to content

Commit

Permalink
removed entrypoints field from jimple cfg
Browse files Browse the repository at this point in the history
  • Loading branch information
sahilagichani14 committed Oct 1, 2024
1 parent f5ba85d commit dc383ff
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ public class JimpleBasedInterproceduralCFG extends AbstractJimpleBasedICFG {

protected static final Logger logger =
LoggerFactory.getLogger(JimpleBasedInterproceduralCFG.class);
private List<MethodSignature> entryPoints;

protected boolean includeReflectiveCalls;

Expand Down Expand Up @@ -123,14 +122,17 @@ public JimpleBasedInterproceduralCFG(
super(enableExceptions);
this.includeReflectiveCalls = includeReflectiveCalls;
this.view = view;
this.entryPoints = cg.getEntryMethods();
this.cg = cg;
initializeStmtToOwner();
}

public CallGraph getCg() {
return cg;
}

public String buildICFGGraph(CallGraph callGraph) {
Map<MethodSignature, StmtGraph<?>> signatureToStmtGraph = new LinkedHashMap<>();
computeAllCalls(entryPoints, signatureToStmtGraph, callGraph);
computeAllCalls(callGraph.getEntryMethods(), signatureToStmtGraph, callGraph);
return ICFGDotExporter.buildICFGGraph(signatureToStmtGraph, view, callGraph);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ public static void setup() {
@Test
void methodStartAndEndPointTest() {
JimpleBasedInterproceduralCFG forwardICFG =
new JimpleBasedInterproceduralCFG(view, entryMethodSignature, false, false);
new JimpleBasedInterproceduralCFG(
view, Collections.singletonList(entryMethodSignature), false, false);

BackwardsInterproceduralCFG backwardsInterproceduralCFG =
new BackwardsInterproceduralCFG(forwardICFG);
Expand All @@ -58,7 +59,8 @@ void methodStartAndEndPointTest() {
@Test
void methodToCallerStmtTest() {
JimpleBasedInterproceduralCFG forwardICFG =
new JimpleBasedInterproceduralCFG(view, entryMethodSignature, false, false);
new JimpleBasedInterproceduralCFG(
view, Collections.singletonList(entryMethodSignature), false, false);

BackwardsInterproceduralCFG backwardsInterproceduralCFG =
new BackwardsInterproceduralCFG(forwardICFG);
Expand Down

0 comments on commit dc383ff

Please sign in to comment.