Skip to content

Commit

Permalink
cast offset to intptr_t to avoid overflow
Browse files Browse the repository at this point in the history
  • Loading branch information
sendaoYan committed Dec 20, 2024
1 parent 6abd26e commit 4e54333
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/hotspot/share/oops/compressedKlass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ void CompressedKlassPointers::sanity_check_after_initialization() {

// Check that Klass range is fully engulfed in the encoding range
const address encoding_start = _base;
const address encoding_end = (address)((intptr_t)_base + nth_bit(narrow_klass_pointer_bits() + _shift));
const address encoding_end = (address)((intptr_t)_base + (intptr_t)nth_bit(narrow_klass_pointer_bits() + _shift));
ASSERT_HERE_2(_klass_range_start >= _base && _klass_range_end <= encoding_end,
"Resulting encoding range does not fully cover the class range");

Expand Down

0 comments on commit 4e54333

Please sign in to comment.