aboutsummaryrefslogtreecommitdiff
path: root/opcodes
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2020-02-03 11:26:30 +1030
committerAlan Modra <amodra@gmail.com>2020-02-03 15:59:08 +1030
commit44e4546fa278122fb1ad708cf8d4835a5af0a11c (patch)
treeb2d0f10c84b303858a65213bfee40cb4fba77ef6 /opcodes
parentef4627fabaebd4f4a2bc2c5e92c95d747f388d78 (diff)
downloadgdb-44e4546fa278122fb1ad708cf8d4835a5af0a11c.zip
gdb-44e4546fa278122fb1ad708cf8d4835a5af0a11c.tar.gz
gdb-44e4546fa278122fb1ad708cf8d4835a5af0a11c.tar.bz2
ubsan: m32c: left shift of negative value
cpu/ * m32c.cpu (f-dsp-64-s16): Mask before shifting signed value. opcodes/ * m32c-ibld.c: Regenerate.
Diffstat (limited to 'opcodes')
-rw-r--r--opcodes/ChangeLog4
-rw-r--r--opcodes/m32c-ibld.c4
2 files changed, 6 insertions, 2 deletions
diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog
index 6349ff0..126025a 100644
--- a/opcodes/ChangeLog
+++ b/opcodes/ChangeLog
@@ -1,3 +1,7 @@
+2020-02-03 Alan Modra <amodra@gmail.com>
+
+ * m32c-ibld.c: Regenerate.
+
2020-02-01 Alan Modra <amodra@gmail.com>
* frv-ibld.c: Regenerate.
diff --git a/opcodes/m32c-ibld.c b/opcodes/m32c-ibld.c
index 7083a57..36231f2 100644
--- a/opcodes/m32c-ibld.c
+++ b/opcodes/m32c-ibld.c
@@ -1401,7 +1401,7 @@ m32c_cgen_insert_operand (CGEN_CPU_DESC cd,
case M32C_OPERAND_IMM_64_HI :
{
long value = fields->f_dsp_64_s16;
- value = EXTHISI (((HI) (INT) (((((((UINT) (value) >> (8))) & (255))) | (((((value) << (8))) & (65280)))))));
+ value = EXTHISI (((HI) (INT) (((((((UINT) (value) >> (8))) & (255))) | (((((value) & (255))) << (8)))))));
errmsg = insert_normal (cd, value, 0|(1<<CGEN_IFLD_SIGNED), 64, 0, 16, 32, total_length, buffer);
}
break;
@@ -2561,7 +2561,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC cd,
{
long value;
length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 64, 0, 16, 32, total_length, pc, & value);
- value = EXTHISI (((HI) (INT) (((((((UINT) (value) >> (8))) & (255))) | (((((value) << (8))) & (65280)))))));
+ value = EXTHISI (((HI) (INT) (((((((UINT) (value) >> (8))) & (255))) | (((((value) & (255))) << (8)))))));
fields->f_dsp_64_s16 = value;
}
break;