8222502: Replace 19,20 case alternatives with JVM_CONSTANT_Module/Package names

Add JVM_CONSTANT_Module and JVM_CONSTANT_Package to classfile_constants.h

Reviewed-by: coleenp, hseigel
This commit is contained in:
Lois Foltan 2019-04-23 07:05:38 -04:00
parent 86eaf87d1f
commit 4f2478e234
5 changed files with 15 additions and 6 deletions

View file

@ -126,7 +126,8 @@
#define JAVA_13_VERSION 57
void ClassFileParser::set_class_bad_constant_seen(short bad_constant) {
assert((bad_constant == 19 || bad_constant == 20) && _major_version >= JAVA_9_VERSION,
assert((bad_constant == JVM_CONSTANT_Module ||
bad_constant == JVM_CONSTANT_Package) && _major_version >= JAVA_9_VERSION,
"Unexpected bad constant pool entry");
if (_bad_constant_seen == 0) _bad_constant_seen = bad_constant;
}
@ -343,8 +344,8 @@ void ClassFileParser::parse_constant_pool_entries(const ClassFileStream* const s
}
break;
}
case 19:
case 20: {
case JVM_CONSTANT_Module:
case JVM_CONSTANT_Package: {
// Record that an error occurred in these two cases but keep parsing so
// that ACC_Module can be checked for in the access_flags. Need to
// throw NoClassDefFoundError in that case.