Community
Participate
Working Groups
When invalid code is getting compiled, the stack map frame generation should not fail with NPE. java.lang.NullPointerException at org.eclipse.jdt.internal.compiler.codegen.StackMapFrameCodeStream.getfield(StackMapFrameCodeStream.java:799) at org.eclipse.jdt.internal.compiler.ast.QualifiedNameReference.generateReadSequence(QualifiedNameReference.java:653) at org.eclipse.jdt.internal.compiler.ast.QualifiedNameReference.generateCode(QualifiedNameReference.java:386) at org.eclipse.jdt.internal.compiler.ast.ReturnStatement.generateCode(ReturnStatement.java:126) at org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.generateCode(AbstractMethodDeclaration.java:229) at org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.generateCode(AbstractMethodDeclaration.java:176) It should protect itself against this and the code should fail at runtime with a VerifyError since the code generation produced invalid bytecodes.
Steps to reproduce: change line 595 in QualifiedNameReference with: if ((needValue && !lastFieldBinding.isStatic())) { and execute GenericTypeTest#test1116 in 1.6 mode.
Created attachment 61108 [details] Proposed fix
Released for 3.3M6.
Verified for 3.3 M6 using I20070319-1800.