Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8082808 | emb-9 | Harold Seigel | P3 | Resolved | Fixed | team |
The split verifier incorrectly throws VerifyError for a getstatic bytecode whose field reference is an array.
For example, the verifier throws:
% $JAVA_HOME/bin/java foo
Exception in thread "main" java.lang.VerifyError: Expecting reference to class in class foo at constant pool index 10
Exception Details:
Location:
foo.main([Ljava/lang/String;)V @0: getstatic
Reason:
Invalid type: '[C' (constant pool 10)
For this:
Constant pool:
#3 = Fieldref #36.#37 // "[C".out:Ljava/io/PrintStream;
...
#36 = Class #55 // "[C"
#37 = NameAndType #57:#58 // out:Ljava/io/PrintStream;
...
#55 = Utf8 [C
...
#57 = Utf8 out
#58 = Utf8 Ljava/io/PrintStream;
Code:
0: getstatic #3 // Field "[C".out:Ljava/io/PrintStream;
The old verifier does not throw a VerifyError for this case.
See attached test case foo.jasm
For example, the verifier throws:
% $JAVA_HOME/bin/java foo
Exception in thread "main" java.lang.VerifyError: Expecting reference to class in class foo at constant pool index 10
Exception Details:
Location:
foo.main([Ljava/lang/String;)V @0: getstatic
Reason:
Invalid type: '[C' (constant pool 10)
For this:
Constant pool:
#3 = Fieldref #36.#37 // "[C".out:Ljava/io/PrintStream;
...
#36 = Class #55 // "[C"
#37 = NameAndType #57:#58 // out:Ljava/io/PrintStream;
...
#55 = Utf8 [C
...
#57 = Utf8 out
#58 = Utf8 Ljava/io/PrintStream;
Code:
0: getstatic #3 // Field "[C".out:Ljava/io/PrintStream;
The old verifier does not throw a VerifyError for this case.
See attached test case foo.jasm
- backported by
-
JDK-8082808 Split Verifier incorrectly throws VerifyError for getstatic of an array field
-
- Resolved
-
- relates to
-
JDK-8056119 4.10.1.9: Clarify that FieldClass cannot be an array type in getfield/putfield
-
- Closed
-