mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-25 13:27:26 +08:00
ubsan: m32r: left shift of negative value
cpu/ * m32r.cpu (f-disp8): Avoid left shift of negative values. (f-disp16, f-disp24): Likewise. opcodes/ * m32r-ibld.c: Regenerate.
This commit is contained in:
@ -723,7 +723,7 @@ m32r_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_RELOC)|(1<<CGEN_IFLD_PCREL_ADDR), 0, 16, 16, 32, total_length, pc, & value);
|
||||
value = ((((value) << (2))) + (pc));
|
||||
value = ((((value) * (4))) + (pc));
|
||||
fields->f_disp16 = value;
|
||||
}
|
||||
break;
|
||||
@ -731,7 +731,7 @@ m32r_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_RELOC)|(1<<CGEN_IFLD_PCREL_ADDR), 0, 8, 24, 32, total_length, pc, & value);
|
||||
value = ((((value) << (2))) + (pc));
|
||||
value = ((((value) * (4))) + (pc));
|
||||
fields->f_disp24 = value;
|
||||
}
|
||||
break;
|
||||
@ -739,7 +739,7 @@ m32r_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_RELOC)|(1<<CGEN_IFLD_PCREL_ADDR), 0, 8, 8, 32, total_length, pc, & value);
|
||||
value = ((((value) << (2))) + (((pc) & (-4))));
|
||||
value = ((((value) * (4))) + (((pc) & (-4))));
|
||||
fields->f_disp8 = value;
|
||||
}
|
||||
break;
|
||||
|
Reference in New Issue
Block a user