aboutsummaryrefslogtreecommitdiff
path: root/opcodes/or1k-ibld.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2019-12-20 14:37:44 +1030
committerAlan Modra <amodra@gmail.com>2019-12-20 17:57:58 +1030
commitbcd9f578a96b9776e34e5cec963928f5a96b80e7 (patch)
tree81184dfccbbea896f95a5a0eedad2c2965f55ec4 /opcodes/or1k-ibld.c
parente76832f125f6f005ddf3c75b7be675272568b01e (diff)
downloadgdb-bcd9f578a96b9776e34e5cec963928f5a96b80e7.zip
gdb-bcd9f578a96b9776e34e5cec963928f5a96b80e7.tar.gz
gdb-bcd9f578a96b9776e34e5cec963928f5a96b80e7.tar.bz2
ubsan: or1k: left shift of negative value
cpu/ * or1korbis.cpu (f-disp26, f-disp21): Don't left shift negative values. opcodes/ * or1k-ibld.c: Regenerate.
Diffstat (limited to 'opcodes/or1k-ibld.c')
-rw-r--r--opcodes/or1k-ibld.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/opcodes/or1k-ibld.c b/opcodes/or1k-ibld.c
index 6271f5c..57eeb52 100644
--- a/opcodes/or1k-ibld.c
+++ b/opcodes/or1k-ibld.c
@@ -783,7 +783,7 @@ or1k_cgen_extract_operand (CGEN_CPU_DESC cd,
{
long value;
length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED)|(1<<CGEN_IFLD_ABS_ADDR), 0, 20, 21, 32, total_length, pc, & value);
- value = ((((value) + (((DI) (pc) >> (13))))) << (13));
+ value = ((((value) + (((DI) (pc) >> (13))))) * (MAKEDI (0, 8192)));
fields->f_disp21 = value;
}
break;
@@ -791,7 +791,7 @@ or1k_cgen_extract_operand (CGEN_CPU_DESC cd,
{
long value;
length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED)|(1<<CGEN_IFLD_PCREL_ADDR), 0, 25, 26, 32, total_length, pc, & value);
- value = ((((value) << (2))) + (pc));
+ value = ((((value) * (MAKEDI (0, 4)))) + (pc));
fields->f_disp26 = value;
}
break;