diff options
author | Sverker Eriksson <[email protected]> | 2019-01-30 15:39:53 +0100 |
---|---|---|
committer | Sverker Eriksson <[email protected]> | 2019-01-30 15:40:58 +0100 |
commit | 34e50bccfcf64bb31358f4fa4b220de71f5bae06 (patch) | |
tree | 13525bc8ce4881ee926c616dfb9168e94845fb0c /erts | |
parent | db2c3c83fd3059cec4c5de3ece8c96fe2c97233a (diff) | |
download | otp-34e50bccfcf64bb31358f4fa4b220de71f5bae06.tar.gz otp-34e50bccfcf64bb31358f4fa4b220de71f5bae06.tar.bz2 otp-34e50bccfcf64bb31358f4fa4b220de71f5bae06.zip |
erts: Fix compiler warning for IS_SSMALL
"shift count negative or too big, undefined behavior"
Diffstat (limited to 'erts')
-rw-r--r-- | erts/emulator/beam/big.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/erts/emulator/beam/big.h b/erts/emulator/beam/big.h index 6e6d7b5a4b..274482a0d2 100644 --- a/erts/emulator/beam/big.h +++ b/erts/emulator/beam/big.h @@ -81,7 +81,11 @@ typedef Uint dsize_t; /* Vector size type */ * a Uint64 argument. Therefore, we must test the size of the argument * to ensure that the cast does not discard the high-order 32 bits. */ -#define _IS_SSMALL32(x) (((Uint32) ((((x)) >> (SMALL_BITS-1)) + 1)) < 2) +#if defined(ARCH_32) +# define _IS_SSMALL32(x) (((Uint32) ((((x)) >> (SMALL_BITS-1)) + 1)) < 2) +#else +# define _IS_SSMALL32(x) (1) +#endif #define _IS_SSMALL64(x) (((Uint64) ((((x)) >> (SMALL_BITS-1)) + 1)) < 2) #define IS_SSMALL(x) (sizeof(x) == sizeof(Uint32) ? _IS_SSMALL32(x) : _IS_SSMALL64(x)) |