You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
new MultipleConstructors
invokespecial MultipleConstructors.<init>()V
aload 0
iconst_0
invokevirtual TargetClass.myCtorRedirect(I)LMultipleConstructors;
pop
return
Actual bytecode:
aload 0
invokevirtual TargetClass.myCtorRedirect(I)LMultipleConstructors;
pop
aload 0
iconst_0
invokevirtual TargetClass.myCtorRedirect(I)LMultipleConstructors;
pop
return
This then crashes with a VerifyError.
This is caused by Target.findInitNodeFor not checking the descriptor of the target, while BeforeNew.findCtor does.
There is also another issue if constructor calls happen to be nested (e.g. new String(new String(""))). A fix for this could be to keep a counter for the number of new instructions found, and decrement it when an <init> call is found, similar to how you would check balancing brackets.
The text was updated successfully, but these errors were encountered:
Example:
Expected bytecode:
Actual bytecode:
This then crashes with a VerifyError.
This is caused by
Target.findInitNodeFor
not checking the descriptor of the target, whileBeforeNew.findCtor
does.There is also another issue if constructor calls happen to be nested (e.g.
new String(new String(""))
). A fix for this could be to keep a counter for the number of new instructions found, and decrement it when an<init>
call is found, similar to how you would check balancing brackets.The text was updated successfully, but these errors were encountered: