diff options
author | Alan Modra <amodra@gmail.com> | 2020-01-09 06:44:16 +1030 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2020-01-10 17:32:33 +1030 |
commit | 8948cc6971fb82feffc49e2d21747111466ad642 (patch) | |
tree | c71b8b40324ce83b2fb5396f2134f21169da1b21 /gdb/printcmd.c | |
parent | 71780f455fbf35ed4c48e94b4228c55c11a213c8 (diff) | |
download | gdb-8948cc6971fb82feffc49e2d21747111466ad642.zip gdb-8948cc6971fb82feffc49e2d21747111466ad642.tar.gz gdb-8948cc6971fb82feffc49e2d21747111466ad642.tar.bz2 |
ubsan: spu: left shift of negative value
Also fixes a real bug. The DECODE_INSN_I9a and DECODE_INSN_I9b both
use UNSIGNED_EXTRACT for 7 low bits of the result, but this was an
unsigned value due to "insn" being unsigned. DECODE_INSN_I9* is
therefore unsigned too, leading to a zero extension in an expression
using a bfd_vma if bfd_vma is 64 bits.
* opcode/spu.h: Formatting.
(UNSIGNED_EXTRACT): Use 1u.
(SIGNED_EXTRACT): Don't sign extend with shifts.
(DECODE_INSN_I9a, DECODE_INSN_I9b): Avoid left shift of signed value.
Keep result signed.
(DECODE_INSN_U9a, DECODE_INSN_U9b): Delete.
Diffstat (limited to 'gdb/printcmd.c')
0 files changed, 0 insertions, 0 deletions