Skip to content
Permalink
Browse files
8263396: Atomic::CmpxchgByteUsingInt::set_byte_in_int needs an explic…
…it cast

Reviewed-by: dholmes
  • Loading branch information
Aleksei Voitylov authored and David Holmes committed Apr 30, 2021
1 parent 07ecd42 commit eb8db12ce67b10957fa94fbf61d9a30db34ec01a
Showing with 2 additions and 1 deletion.
  1. +2 −1 src/hotspot/share/runtime/atomic.hpp
@@ -818,7 +818,8 @@ inline uint32_t Atomic::CmpxchgByteUsingInt::set_byte_in_int(uint32_t n,
uint8_t b,
uint32_t idx) {
int bitsIdx = BitsPerByte * idx;
return (n & ~(0xff << bitsIdx)) | (b << bitsIdx);
return (n & ~(static_cast<uint32_t>(0xff) << bitsIdx))
| (static_cast<uint32_t>(b) << bitsIdx);
}

inline uint8_t Atomic::CmpxchgByteUsingInt::get_byte_in_int(uint32_t n,

0 comments on commit eb8db12

Please sign in to comment.