Community
Participate
Working Groups
java.lang.VerifyError: (class: Tester, method: main signature: ([Ljava/lang/String;)V) Unable to pop operand off an empty stack Exception in thread "main" jdk is 1.4.2 --------------------------- snip ------------------------------- public class Tester { public static void main(String[] args) { Test2 t2 = new Test2(); t2.test = new Test(); t2.test.str = ""+t2.test.num; } } class Test { public String str; public int num; } class Test2 { public static Test test = null; }
jdt, not platform
The problem comes from the code generation of the t2.test.str qualified name reference. We generate a getClass() as a null check because test is a static field. The problem is that t2 is not on the stack so getClass() is invoked with an empty stack.
I have a fix for this.
Fixed, regression test added. In this scenario, the lastFieldBinding was not correctly positionned when first binding is local variable. case LOCAL : // reading the first local variable >>>> lastFieldBinding = null; if (!needValue) break; // no value needed
Verified.