aboutsummaryrefslogtreecommitdiff
path: root/gas/config/tc-sh.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2020-08-31 16:42:42 +0930
committerAlan Modra <amodra@gmail.com>2020-08-31 20:28:12 +0930
commit8659fff005fd09cebaa1af5a76962ec77cce320c (patch)
tree1a3d449ce016d8ae093d9780a328bb322178ce92 /gas/config/tc-sh.c
parent548c8b2ba71f5c93035028a32a596cca37c9b7cf (diff)
downloadfsf-binutils-gdb-8659fff005fd09cebaa1af5a76962ec77cce320c.zip
fsf-binutils-gdb-8659fff005fd09cebaa1af5a76962ec77cce320c.tar.gz
fsf-binutils-gdb-8659fff005fd09cebaa1af5a76962ec77cce320c.tar.bz2
PR26497 UBSAN: tc-sh.c:2467 left shift cannot be represented
PR 26497 * config/tc-sh.c (assemble_ppi): Use unsigned variables.
Diffstat (limited to 'gas/config/tc-sh.c')
-rw-r--r--gas/config/tc-sh.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/gas/config/tc-sh.c b/gas/config/tc-sh.c
index e1e509d..ea90522 100644
--- a/gas/config/tc-sh.c
+++ b/gas/config/tc-sh.c
@@ -2205,12 +2205,12 @@ find_cooked_opcode (char **str_p)
static unsigned int
assemble_ppi (char *op_end, sh_opcode_info *opcode)
{
- int movx = 0;
- int movy = 0;
- int cond = 0;
- int field_b = 0;
+ unsigned int movx = 0;
+ unsigned int movy = 0;
+ unsigned int cond = 0;
+ unsigned int field_b = 0;
char *output;
- int move_code;
+ unsigned int move_code;
unsigned int size;
for (;;)
@@ -2464,7 +2464,7 @@ assemble_ppi (char *op_end, sh_opcode_info *opcode)
if (field_b)
{
/* Parallel processing insn. */
- unsigned long ppi_code = (movx | movy | 0xf800) << 16 | field_b;
+ unsigned int ppi_code = (movx | movy | 0xf800) << 16 | field_b;
output = frag_more (4);
size = 4;