8340110: Ubsan: verifier.cpp:2043:19: runtime error: shift exponent 100 is too large for 32-bit type 'int'

Reviewed-by: dholmes, jsjolen
This commit is contained in:
Afshin Zafari 2025-02-18 09:56:38 +00:00
parent ff05d97953
commit 160db5f0f0

View File

@ -2037,7 +2037,8 @@ void ClassVerifier::verify_cp_type(
verify_cp_index(bci, cp, index, CHECK_VERIFY(this));
unsigned int tag = cp->tag_at(index).value();
if ((types & (1 << tag)) == 0) {
// tags up to JVM_CONSTANT_ExternalMax are verifiable and valid for shift op
if (tag > JVM_CONSTANT_ExternalMax || (types & (1 << tag)) == 0) {
verify_error(ErrorContext::bad_cp_index(bci, index),
"Illegal type at constant pool entry %d in class %s",
index, cp->pool_holder()->external_name());