diff options
author | 2017-12-12 10:06:45 +0000 | |
---|---|---|
committer | 2017-12-12 10:06:45 +0000 | |
commit | 09bcd67d4cdf3a1c944c334a15ae2c6b32b9a775 (patch) | |
tree | 8db578d927835de61470b081b435583fff46c607 | |
parent | stray , snuck in (diff) | |
download | wireguard-openbsd-09bcd67d4cdf3a1c944c334a15ae2c6b32b9a775.tar.xz wireguard-openbsd-09bcd67d4cdf3a1c944c334a15ae2c6b32b9a775.zip |
Avoid undefined behaviour in rorate_left() macro. From NetBSD via FreeBSD.
Makes gas work when compiled with clang.
ok patrick@, millert@
-rw-r--r-- | gnu/usr.bin/binutils-2.17/gas/config/tc-arm.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gnu/usr.bin/binutils-2.17/gas/config/tc-arm.c b/gnu/usr.bin/binutils-2.17/gas/config/tc-arm.c index da965a0dff8..e00afa2816d 100644 --- a/gnu/usr.bin/binutils-2.17/gas/config/tc-arm.c +++ b/gnu/usr.bin/binutils-2.17/gas/config/tc-arm.c @@ -4266,7 +4266,7 @@ parse_operands (char *str, const unsigned char *pattern) /* Functions for operand encoding. ARM, then Thumb. */ -#define rotate_left(v, n) (v << n | v >> (32 - n)) +#define rotate_left(v, n) (v << (n % 32) | v >> ((32 - n) % 32)) /* If VAL can be encoded in the immediate field of an ARM instruction, return the encoded form. Otherwise, return FAIL. */ |