aboutsummaryrefslogtreecommitdiff
path: root/bfd/xtensa-isa.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2019-12-20 12:44:33 +1030
committerAlan Modra <amodra@gmail.com>2019-12-20 13:36:06 +1030
commite76832f125f6f005ddf3c75b7be675272568b01e (patch)
tree64aa304a0b8460b0783eaf1eb582fe15250e1eb3 /bfd/xtensa-isa.c
parent15d2859fddcb769e59b906f9443c85afdd5d7380 (diff)
downloadgdb-e76832f125f6f005ddf3c75b7be675272568b01e.zip
gdb-e76832f125f6f005ddf3c75b7be675272568b01e.tar.gz
gdb-e76832f125f6f005ddf3c75b7be675272568b01e.tar.bz2
ubsan: xtensa: left shift cannot be represented in type 'int'
* xtensa-isa.c (xtensa_insnbuf_from_chars): Avoid signed overflow.
Diffstat (limited to 'bfd/xtensa-isa.c')
-rw-r--r--bfd/xtensa-isa.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/bfd/xtensa-isa.c b/bfd/xtensa-isa.c
index 172de6f..9ddc6cd 100644
--- 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;
}
}