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

Fix insertAuxInitializer may cause inconsistent stack height problem #469

Merged

Conversation

shifujun
Copy link
Contributor

Usually, constructor only load super class's constructor's init params into stack. After this() or super() called, stack will be empty. If so, we insertAuxInitializer right after this() or super() can reuse max stack size if it enough.

But, there is some weird class out there, their constructors load all in-constructor init field value into stack before this() or super() call. In this case, after this() or super() call, stack is not empty, even maybe full.

In summary, insertAuxInitializer should increase MaxStack anyway.

Tencent/Shadow#1196

Usually, constructor only load super class's constructor's init params into stack.
After this() or super() called, stack will be empty. If so, we insertAuxInitializer
right after this() or super() can reuse max stack size if it enough.

But, there is some weird class out there, their constructors load all in-constructor
init field value into stack before this() or super() call. In this case,
after this() or super() call, stack is not empty, even maybe full.

In summary, insertAuxInitializer should increase MaxStack anyway.
@chibash chibash merged commit 3325b49 into jboss-javassist:master Dec 16, 2023
2 checks passed
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.

None yet

2 participants