-
Notifications
You must be signed in to change notification settings - Fork 136
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
[regression] java.lang.VerifyError: Operand stack overflow #1256
Comments
@jarthana : could you please take a look? |
A potential patch:
|
|
@iloveeclipse I will try. |
@iloveeclipse I have updated the regression tests. |
Thanks. But can you please add your own test (with the snippet from bug description) that shows the fix is working? |
|
I think the reason why the fix works is it increments the stack length by way of valueOf, which makes enough room for the subsequent iconst_1 operation. Of course, the problem was we were short on stack length to begin with is the cause and hence the fix works. Perhaps we should investigate why the stack is insufficient. If I make the following change, I don't see the problem:
|
OK, I see that right after the concat statement, the stackDepth goes down by one. The reason is, we don't really add any stackDepth for the null operand as a result of this code but later the invokedynamic makes decrements the stackDepth by one (because arguments - returntypes = -1) :
We have two options:
I am inclined to go with the first. @snjeza Your patch works, but it generates lot of additional code for the null constant. What do you think of the options I just mentioned? |
@snjeza Here's an alternate fix : #1265 |
@jarthana #1265 fixes the issue, but ConstantTest.test009() should be fixed. |
…t#1256 (eclipse-jdt#1265) Optimizing away the aconstnull doesn't increment the stackdepth, which is causing the issue. The fix puts it back. Co-authored-by: Snjezana Peco <snjezana.peco@redhat.com>
Related issues
Steps to reproduce
It throws
A workaorund
set
org.eclipse.jdt.core.compiler.codegen.useStringConcatFactory = disabled
The issue has been caused by be45d8f
It can't be reproduced in Eclipse <= I20230628-1800
The text was updated successfully, but these errors were encountered: