From 160db5f0f000f8471f71e0725da862d57db28c8a Mon Sep 17 00:00:00 2001 From: Afshin Zafari Date: Tue, 18 Feb 2025 09:56:38 +0000 Subject: [PATCH] 8340110: Ubsan: verifier.cpp:2043:19: runtime error: shift exponent 100 is too large for 32-bit type 'int' Reviewed-by: dholmes, jsjolen --- src/hotspot/share/classfile/verifier.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/hotspot/share/classfile/verifier.cpp b/src/hotspot/share/classfile/verifier.cpp index 95e5f55c172..1e9bdcc682d 100644 --- a/src/hotspot/share/classfile/verifier.cpp +++ b/src/hotspot/share/classfile/verifier.cpp @@ -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());