This is the mail archive of the binutils-cvs@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] Fixes a compile time warnng about left shifting a negative value.


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=24b4cf66a626566e7903813a2e0156778f4903f9

commit 24b4cf66a626566e7903813a2e0156778f4903f9
Author: Szabolcs Nagy <szabolcs.nagy@arm.com>
Date:   Tue Jun 16 13:35:33 2015 +0100

    Fixes a compile time warnng about left shifting a negative value.
    
    	* arm-dis.c (print_insn_coprocessor): Avoid negative shift.

Diff:
---
 opcodes/ChangeLog | 4 ++++
 opcodes/arm-dis.c | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog
index bf54219..fe9134d 100644
--- a/opcodes/ChangeLog
+++ b/opcodes/ChangeLog
@@ -1,3 +1,7 @@
+2015-06-16  Szabolcs Nagy  <szabolcs.nagy@arm.com>
+
+	* arm-dis.c (print_insn_coprocessor): Avoid negative shift.
+
 2015-06-12  Peter Bergner  <bergner@vnet.ibm.com>
 
 	* ppc-opc.c: Add comment accidentally removed by old commit.
diff --git a/opcodes/arm-dis.c b/opcodes/arm-dis.c
index e9f4425..818847d 100644
--- a/opcodes/arm-dis.c
+++ b/opcodes/arm-dis.c
@@ -3352,7 +3352,7 @@ print_insn_coprocessor (bfd_vma pc,
 
 		    /* Is ``imm'' a negative number?  */
 		    if (imm & 0x40)
-		      imm |= (-1 << 7);
+		      imm -= 0x80;
 
 		    func (stream, "%d", imm);
 		  }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]