src: Fix undefined behaviour
Cppcheck produces the following warnings: ``` shared_string.hh:27:49: portability: Shifting signed 32-bit value by 31 bits is implementation-defined behaviour shared_string.hh:27:49: error: Signed integer overflow for expression '1<<31'. ``` Fixes #4340
This commit is contained in:
parent
367879ddcf
commit
c57a86ce62
|
@ -24,7 +24,7 @@ struct StringData : UseMemoryDomain<MemoryDomain::SharedString>
|
||||||
private:
|
private:
|
||||||
StringData(int len) : refcount(0), length(len) {}
|
StringData(int len) : refcount(0), length(len) {}
|
||||||
|
|
||||||
static constexpr uint32_t interned_flag = 1 << 31;
|
static constexpr uint32_t interned_flag = 1u << 31;
|
||||||
static constexpr uint32_t refcount_mask = ~interned_flag;
|
static constexpr uint32_t refcount_mask = ~interned_flag;
|
||||||
|
|
||||||
struct PtrPolicy
|
struct PtrPolicy
|
||||||
|
|
Loading…
Reference in New Issue
Block a user