On Jun 21, 2017, at 1:59 PM, Paul Sandoz <paul.san...@oracle.com> wrote: > > Relevant bit: > > CONSTANT_ConstantDynamic_info { > u1 tag; > u2 bootstrap_method_attr_index; > u2 name_and_type_index; > } > > The value of the name_and_type_index item must be a valid index into the > constant_pool table. The constant_pool entry at > that index must be a CONSTANT_NameAndType_info structure (§4.4.6) > representing a field name and field descriptor (§4.3.2). > > i.e. name and descriptor indexed by CONSTANT_NameAndType_info must conform to > a field name and field descriptor respectively, but there is no such actual > field.
We could have slightly different rules for constant names, but that would complicate the structural constraints on C_NAT, with no particular benefit. As it is, you can validate a C_NAT without asking who is using it.