[constant-folding] More indy experiments
Maurizio Cimadamore
maurizio.cimadamore at oracle.com
Wed May 10 10:01:11 UTC 2017
On 10/05/17 10:55, Maurizio Cimadamore wrote:
> As for your issue, (1) is clearly a bug - albeit not sure if it's in
> the compiler or the BSM runtime - Vicente please take a look.
I retract my statement.
CONSTANT_InvokeDynamic is laid out like this, as per 4.4.10
CONSTANT_InvokeDynamic_info {
u1 tag;
u2 bootstrap_method_attr_index;
u2 name_and_type_index;
}
Now, the spec just says that 'name_and_type_index' must be a legal name
and type entry - so let's follow that path (4.4.6):
CONSTANT_NameAndType_info {
u1 tag;
u2 name_index;
u2 descriptor_index;
}
The spec here says that 'name_index' should be a "valid unqualified name
denoting a field or method (4.2.2)."
And, if we look at 4.2.2, we find that "An unqualified name must contain
at least one Unicode code point [...]". Hence the verifier error.
Long story short, this problem should be caught at compile time.
Cheers
Maurizio
More information about the amber-dev
mailing list