--- old/src/hotspot/share/classfile/verifier.hpp 2019-03-11 14:25:41.966355490 +0100 +++ new/src/hotspot/share/classfile/verifier.hpp 2019-03-11 14:25:41.762355493 +0100 @@ -39,7 +39,7 @@ STACKMAP_ATTRIBUTE_MAJOR_VERSION = 50, INVOKEDYNAMIC_MAJOR_VERSION = 51, NO_RELAX_ACCESS_CTRL_CHECK_VERSION = 52, - DYNAMICCONSTANT_MAJOR_VERSION = 55 + DYNAMICCONSTANT_MAJOR_VERSION = 55, }; // Verify the bytecodes for a class. @@ -153,6 +153,7 @@ STACK_UNDERFLOW, // Attempt to pop and empty expression stack MISSING_STACKMAP, // No stackmap for this location and there should be BAD_STACKMAP, // Format error in stackmap + WRONG_VALUE_TYPE, // Mismatched value type NO_FAULT, // No error UNKNOWN } FaultType; @@ -216,6 +217,9 @@ static ErrorContext bad_stackmap(int index, StackMapFrame* frame) { return ErrorContext(0, BAD_STACKMAP, TypeOrigin::frame(frame)); } + static ErrorContext bad_value_type(u2 bci, TypeOrigin type, TypeOrigin exp) { + return ErrorContext(bci, WRONG_VALUE_TYPE, type, exp); + } bool is_valid() const { return _fault != NO_FAULT; } int bci() const { return _bci; } @@ -402,7 +406,14 @@ SignatureStream* sig_type, VerificationType* inference_type, TRAPS); VerificationType cp_index_to_type(int index, const constantPoolHandle& cp, TRAPS) { - return VerificationType::reference_type(cp->klass_name_at(index)); + Symbol* name = cp->klass_name_at(index); + if (name->is_Q_signature()) { + // Remove the Q and ; + // TBD need error msg if fundamental_name() returns NULL? + Symbol* fund_name = name->fundamental_name(CHECK_(VerificationType::bogus_type())); + return VerificationType::valuetype_type(fund_name); + } + return VerificationType::reference_type(name); } // Keep a list of temporary symbols created during verification because @@ -435,8 +446,16 @@ // Create another symbol to save as signature stream unreferences this symbol. Symbol* name_copy = create_temporary_symbol(name); assert(name_copy == name, "symbols don't match"); - *inference_type = - VerificationType::reference_type(name_copy); + *inference_type = VerificationType::reference_type(name_copy); + return 1; + } + case T_VALUETYPE: + { + Symbol* vname = sig_type->as_symbol(CHECK_0); + // Create another symbol to save as signature stream unreferences this symbol. + Symbol* vname_copy = create_temporary_symbol(vname); + assert(vname_copy == vname, "symbols don't match"); + *inference_type = VerificationType::valuetype_type(vname_copy); return 1; } case T_LONG: