Alan Modra b4617f7904 i386-dis.c UB shift and other tidies
1) i386-dis.c:12055:11: runtime error: left shift of negative value -1
Bit twiddling is best done unsigned, due to UB on overflow of signed
expressions.  Fix this by using bfd_vma rather than bfd_signed_vma
everywhere in i386-dis.c except print_displacement.

2) Return get32s and get16 value in a bfd_vma, reducing the need for
temp variables.

3) Introduce get16s and get8s functions to simplify the code.

4) With some optimisation options gcc-13 legitimately complains about
a fall-through in OP_I.  Fix that.  OP_I also doesn't need to use
"mask" which was wrong for w_mode anyway.

5) Masking with & 0xffffffff is better than casting to unsigned.  We
don't know for sure that unsigned int is 32-bit.

6) We also don't know that unsigned char is 8 bits.  Mask codep
accesses everywhere.  I don't expect binutils will work on anything
other than an 8-bit char host, but if we are masking codep accesses in
some places we might as well be consistent.  (Better would be to use
stdint.h types more in binutils.)
2023-04-26 12:06:33 +09:30
..
2022-07-09 20:10:47 +09:30
2023-04-12 18:45:09 +03:00
2021-01-01 10:31:02 +10:30
2022-01-01 12:49:07 -05:00
2022-11-02 09:19:20 +08:00
2023-04-07 05:47:01 +00:00
2023-04-07 05:47:01 +00:00
2023-04-07 05:47:01 +00:00
2023-04-07 05:47:01 +00:00
2023-04-07 05:47:01 +00:00
2023-04-07 05:47:01 +00:00
2023-03-16 17:30:19 +10:30
2023-03-16 17:30:19 +10:30