The LoadableDescriptors attribute supports all FieldDescriptors which are expressed with the following grammar:
```
FieldDescriptor:
FieldType
FieldType:
BaseType
ClassType
ArrayType
BaseType:
(one of)
B C D F I J S Z
ClassType:
L ClassName ;
ArrayType:
[ ComponentType
ComponentType:
FieldType
```
Only the "ClassType" descriptors are meaningful to the JVM as they are ones which can be speculatively loaded.
Update the classFileParser logic to:
1) Validate all LD elements as FieldDescriptors (already what it does today)
2) Drop the non-ClassType (ie: non "L" Foo ";") elements so the rest of the JVM never sees them,
```
FieldDescriptor:
FieldType
FieldType:
BaseType
ClassType
ArrayType
BaseType:
(one of)
B C D F I J S Z
ClassType:
L ClassName ;
ArrayType:
[ ComponentType
ComponentType:
FieldType
```
Only the "ClassType" descriptors are meaningful to the JVM as they are ones which can be speculatively loaded.
Update the classFileParser logic to:
1) Validate all LD elements as FieldDescriptors (already what it does today)
2) Drop the non-ClassType (ie: non "L" Foo ";") elements so the rest of the JVM never sees them,
- relates to
-
JDK-8366907 Valhalla: Disallow non-class LoadableDescriptors attributes
-
- Closed
-