projects
/
binutils-gdb.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
15d2859
)
ubsan: xtensa: left shift cannot be represented in type 'int'
author
Alan Modra
<amodra@gmail.com>
Fri, 20 Dec 2019 02:14:33 +0000
(12:44 +1030)
committer
Alan Modra
<amodra@gmail.com>
Fri, 20 Dec 2019 03:06:06 +0000
(13:36 +1030)
* xtensa-isa.c (xtensa_insnbuf_from_chars): Avoid signed overflow.
bfd/ChangeLog
patch
|
blob
|
history
bfd/xtensa-isa.c
patch
|
blob
|
history
diff --git
a/bfd/ChangeLog
b/bfd/ChangeLog
index 14aebd93f71b41a41ca0730593b604581c46d98a..40f4b663642506e98d304b86782272567b0a1848 100644
(file)
--- a/
bfd/ChangeLog
+++ b/
bfd/ChangeLog
@@
-1,3
+1,7
@@
+2019-12-20 Alan Modra <amodra@gmail.com>
+
+ * xtensa-isa.c (xtensa_insnbuf_from_chars): Avoid signed overflow.
+
2019-12-20 Alan Modra <amodra@gmail.com>
* libhppa.h (hppa_field_adjust, bfd_hppa_insn2fmt): Delete forward
diff --git
a/bfd/xtensa-isa.c
b/bfd/xtensa-isa.c
index 172de6f41e9b8a535abd6e107de712db33bbe97f..9ddc6cd84442e26aad338401e0553488ee6352b8 100644
(file)
--- a/
bfd/xtensa-isa.c
+++ b/
bfd/xtensa-isa.c
@@
-223,7
+223,7
@@
xtensa_insnbuf_from_chars (xtensa_isa isa,
int word_inx = byte_to_word_index (i);
int bit_inx = byte_to_bit_index (i);
- insn[word_inx] |= (*cp & 0xff) << bit_inx;
+ insn[word_inx] |= (
unsigned) (
*cp & 0xff) << bit_inx;
}
}