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:
Frank LENORMAND 2021-09-10 16:34:38 +03:00
parent 367879ddcf
commit c57a86ce62

View File

@ -24,7 +24,7 @@ struct StringData : UseMemoryDomain<MemoryDomain::SharedString>
private:
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;
struct PtrPolicy