RFR: 8340110: Ubsan: verifier.cpp:2043:19: runtime error: shift exponent 100 is too large for 32-bit type 'int'
David Holmes
dholmes at openjdk.org
Thu Feb 13 21:00:13 UTC 2025
On Mon, 10 Feb 2025 10:20:08 GMT, Afshin Zafari <azafari at openjdk.org> wrote:
> The value 100 for shift comes from a test which shuffles the bytecode contents and tries to verify the resulting bytecode. So, the solution is first check if there is no error in verification then use left-shift to find the type of the class being verified.
Changes requested by dholmes (Reviewer).
src/hotspot/share/classfile/verifier.cpp line 2042:
> 2040: unsigned int tag = cp->tag_at(index).value();
> 2041: // Resolution errors start with JVM_CONSTANT_InternalMin = 100, which is not valid for shift op
> 2042: if (tag >= JVM_CONSTANT_InternalMin || (types & (1 << tag)) == 0) {
Suggestion:
if (tag > JVM_CONSTANT_ExternalMax || (types & (1 << tag)) == 0) {
This excludes the possibility of having a corrupt/bad tag > 32 but < 100
-------------
PR Review: https://git.openjdk.org/jdk/pull/23539#pullrequestreview-2616203829
PR Review Comment: https://git.openjdk.org/jdk/pull/23539#discussion_r1955203130
More information about the hotspot-runtime-dev
mailing list