aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2019-01-30 15:39:53 +0100
committerSverker Eriksson <[email protected]>2019-01-30 15:40:58 +0100
commit34e50bccfcf64bb31358f4fa4b220de71f5bae06 (patch)
tree13525bc8ce4881ee926c616dfb9168e94845fb0c
parentdb2c3c83fd3059cec4c5de3ece8c96fe2c97233a (diff)
downloadotp-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"
-rw-r--r--erts/emulator/beam/big.h6
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))