diff options
author | Alan Modra <amodra@gmail.com> | 2020-01-11 12:32:11 +1030 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2020-01-13 12:12:05 +1030 |
commit | 202e762b322444344827acbf98162fcb2910e0dd (patch) | |
tree | 16e2e65d75ba1e4fb0c66277c2955eb8fd2c322a /opcodes/fr30-ibld.c | |
parent | 7ef412cf72a197d68e532604cc1fa21351adc858 (diff) | |
download | gdb-202e762b322444344827acbf98162fcb2910e0dd.zip gdb-202e762b322444344827acbf98162fcb2910e0dd.tar.gz gdb-202e762b322444344827acbf98162fcb2910e0dd.tar.bz2 |
ubsan: fr30: left shift of negative value
cpu/
* fr30.cpu (f-disp9, f-disp10, f-s10, f-rel9, f-rel12): Don't
left shift signed values.
opcodes/
* fr30-ibld.c: Regenerate.
Diffstat (limited to 'opcodes/fr30-ibld.c')
-rw-r--r-- | opcodes/fr30-ibld.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/opcodes/fr30-ibld.c b/opcodes/fr30-ibld.c index 8f12e4c..ea4ea0a 100644 --- a/opcodes/fr30-ibld.c +++ b/opcodes/fr30-ibld.c @@ -831,7 +831,7 @@ fr30_cgen_extract_operand (CGEN_CPU_DESC cd, { long value; length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 0, 4, 8, 16, total_length, pc, & value); - value = ((value) << (2)); + value = ((value) * (4)); fields->f_disp10 = value; } break; @@ -842,7 +842,7 @@ fr30_cgen_extract_operand (CGEN_CPU_DESC cd, { long value; length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 0, 4, 8, 16, total_length, pc, & value); - value = ((value) << (1)); + value = ((value) * (2)); fields->f_disp9 = value; } break; @@ -867,7 +867,7 @@ fr30_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, 5, 11, 16, total_length, pc, & value); - value = ((((value) << (1))) + (((pc) + (2)))); + value = ((((value) * (2))) + (((pc) + (2)))); fields->f_rel12 = value; } break; @@ -875,7 +875,7 @@ fr30_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, 8, 8, 16, total_length, pc, & value); - value = ((((value) << (1))) + (((pc) + (2)))); + value = ((((value) * (2))) + (((pc) + (2)))); fields->f_rel9 = value; } break; @@ -905,7 +905,7 @@ fr30_cgen_extract_operand (CGEN_CPU_DESC cd, { long value; length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 0, 8, 8, 16, total_length, pc, & value); - value = ((value) << (2)); + value = ((value) * (4)); fields->f_s10 = value; } break; |