2015-11-26 17:31:51 +00:00
|
|
|
From d840c081f8082e8b9e63fead5306643975a97bb3 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Richard Earnshaw <Richard.Earnshaw@arm.com>
|
|
|
|
Date: Thu, 20 Nov 2014 17:02:47 +0000
|
|
|
|
Subject: [PATCH] * config/tc-arm.c (rotate_left): Avoid undefined behaviour
|
|
|
|
when N = 0.
|
|
|
|
|
|
|
|
---
|
2017-12-02 20:44:39 +00:00
|
|
|
gas/config/tc-arm.c | 2 +-
|
|
|
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
2015-11-26 17:31:51 +00:00
|
|
|
|
|
|
|
--- a/gas/config/tc-arm.c
|
|
|
|
+++ b/gas/config/tc-arm.c
|
2017-12-02 20:44:39 +00:00
|
|
|
@@ -7261,7 +7261,7 @@
|
2015-11-26 17:31:51 +00:00
|
|
|
|
|
|
|
/* Functions for operand encoding. ARM, then Thumb. */
|
|
|
|
|
|
|
|
-#define rotate_left(v, n) (v << n | v >> (32 - n))
|
|
|
|
+#define rotate_left(v, n) (v << (n & 31) | v >> ((32 - n) & 31))
|
|
|
|
|
|
|
|
/* If VAL can be encoded in the immediate field of an ARM instruction,
|
|
|
|
return the encoded form. Otherwise, return FAIL. */
|