diff -r 3caf062361a6 -r 34f9c45625d8 hotspot/src/share/vm/classfile/classFileParser.cpp --- a/hotspot/src/share/vm/classfile/classFileParser.cpp Mon May 09 23:49:22 2016 -0700 +++ b/hotspot/src/share/vm/classfile/classFileParser.cpp Tue May 03 12:23:06 2016 +0200 @@ -1401,9 +1401,11 @@ FieldAllocationType update(bool is_static, BasicType type) { FieldAllocationType atype = basic_type_to_atype(is_static, type); - // Make sure there is no overflow with injected fields. - assert(count[atype] < 0xFFFF, "More than 65535 fields"); - count[atype]++; + if (atype != BAD_ALLOCATION_TYPE) { + // Make sure there is no overflow with injected fields. + assert(count[atype] < 0xFFFF, "More than 65535 fields"); + count[atype]++; + } return atype; } }; @@ -3335,8 +3337,9 @@ } } else if (tag == vmSymbols::tag_bootstrap_methods() && _major_version >= Verifier::INVOKEDYNAMIC_MAJOR_VERSION) { - if (parsed_bootstrap_methods_attribute) + if (parsed_bootstrap_methods_attribute) { classfile_parse_error("Multiple BootstrapMethods attributes in class file %s", CHECK); + } parsed_bootstrap_methods_attribute = true; parse_classfile_bootstrap_methods_attribute(cfs, cp, attribute_length, CHECK); } else if (tag == vmSymbols::tag_runtime_visible_type_annotations()) {