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

Callgraph Generation ignores <clinit> #459

Closed
3 tasks done
JonasKlauke opened this issue Mar 8, 2022 · 1 comment · Fixed by #497
Closed
3 tasks done

Callgraph Generation ignores <clinit> #459

JonasKlauke opened this issue Mar 8, 2022 · 1 comment · Fixed by #497

Comments

@JonasKlauke
Copy link
Collaborator

JonasKlauke commented Mar 8, 2022

Currently, the Call graph generation does not analyze the clinit.
Therefore, method calls in the static area are missed and RTA does not know which classes are instantiated in the static area.

Code snippet with both problems

public class B{
    public int foo(){return 8;}
}

public class C extends B{
    public int foo(){return 3;}
    public static C build () {return new C();}
}
public class A {
  static C c=C.build();
  public static void main(String[] args) {
    B b=c;
    b.foo
  }
}
  • unit test for method calls in clinit
  • unit test for instantiated classes in clinit for RTA
  • analyze cinit in the worklist
@JonasKlauke
Copy link
Collaborator Author

JonasKlauke commented Mar 14, 2022

implicit call edge to Clinit and all their superclasses Clinit if:

  • static method is called
  • static attribute is used
  • constructor is called
  • method is a entry point

@JonasKlauke JonasKlauke linked a pull request Dec 1, 2022 that will close this issue
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 a pull request may close this issue.

1 participant