Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8135607 | emb-9 | Harold Seigel | P3 | Resolved | Fixed | team |
JDK-8276294 | openjdk8u322 | Martin Balao Alonso | P3 | Resolved | Fixed | b01 |
JDK-8275560 | openjdk8u312 | Martin Balao Alonso | P3 | Resolved | Fixed | b07 |
JDK-8275612 | openjdk7u | Dmitry Cherepanov | P3 | Resolved | Fixed | master |
According to http://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.7.6-300-D.1-A:
The value of the inner_class_info_index item must be a valid index into the constant_pool table. The constant_pool entry at that index must be a CONSTANT_Class_info structure representing C. The remaining items in the classes array entry give information about C.
Note, that assertion have been changed since the JVMS2 publishing (JVMS2 permitted zero indices for this field): see http://docs.oracle.com/javase/specs/jvms/se6/html/ClassFile.doc.html#80019
Now for both versions, 49 and 52 (was found using jdk9b70), wrong indices (e.g. 8000) are rejected, but zero indices are permitted. Examples (two classes which differs in first InnerClasses record) are attached.
Tests are under development.
I suppose, it would be better either throw CFE for zero index, or accept zero and invalid indices both.
Please, check additional case: anonymous/local classes with zero inner_class_info_index. Anonymous/local classes with inner_class_info_index = 0 are rejected with CFE, but CFE contains inappropriate, but valid message "java.lang.ClassFormatError: Class is both outer and inner class in class file". Additional cases are attached.
The value of the inner_class_info_index item must be a valid index into the constant_pool table. The constant_pool entry at that index must be a CONSTANT_Class_info structure representing C. The remaining items in the classes array entry give information about C.
Note, that assertion have been changed since the JVMS2 publishing (JVMS2 permitted zero indices for this field): see http://docs.oracle.com/javase/specs/jvms/se6/html/ClassFile.doc.html#80019
Now for both versions, 49 and 52 (was found using jdk9b70), wrong indices (e.g. 8000) are rejected, but zero indices are permitted. Examples (two classes which differs in first InnerClasses record) are attached.
Tests are under development.
I suppose, it would be better either throw CFE for zero index, or accept zero and invalid indices both.
Please, check additional case: anonymous/local classes with zero inner_class_info_index. Anonymous/local classes with inner_class_info_index = 0 are rejected with CFE, but CFE contains inappropriate, but valid message "java.lang.ClassFormatError: Class is both outer and inner class in class file". Additional cases are attached.
- backported by
-
JDK-8135607 InnerClasses: VM permits wrong inner_class_info_index value of zero
- Resolved
-
JDK-8275560 InnerClasses: VM permits wrong inner_class_info_index value of zero
- Resolved
-
JDK-8275612 InnerClasses: VM permits wrong inner_class_info_index value of zero
- Resolved
-
JDK-8276294 InnerClasses: VM permits wrong inner_class_info_index value of zero
- Resolved