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

Bytecode verification error after instrumentation of constructors (<init> methods) because of leaking this #424

Open
dmitrii-artuhov opened this issue Nov 14, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@dmitrii-artuhov
Copy link
Collaborator

Currently lincheck omits transformation of <init> methods in the transformers chain (see LincheckClassVisitor::visitMethod).
There is a problem with passing object references to injection methods. This may be observed for instrumentation of GETFIELD/PUTFIELD instructions in constructors:

  • Injections::beforeReadField function accepts as 1st parameter a reference to the object, on which mentioned instructions are invoked.
  • However, if this object is this of the class instance being constructed, then passing it as a parameter to any function will cause VerifyError exception when the jvm will try to load transformed class.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants