ubsan: signed integer overflow in display_debug_lines_raw
authorAlan Modra <amodra@gmail.com>
Wed, 19 Apr 2023 13:46:47 +0000 (23:16 +0930)
committerAlan Modra <amodra@gmail.com>
Wed, 19 Apr 2023 23:33:53 +0000 (09:03 +0930)
commit329dd2b6fcad4b3f1c4b0d443381f7c68ef18a9f
tree94b26ed119aad030db011e3a58711a7e928c1740
parent3b37f0f1b86cc1fb3ba9cc6d89695109db7f829a
ubsan: signed integer overflow in display_debug_lines_raw

This one was caused by me unnecessarily promoting an "int adv" to
"int64_t adv".  The expression overflowing was 4259 + 9223372036854775807
with the left number being unsigned int.

* dwarf.h (DWARF2_Internal_LineInfo): Replace unsigned short
with uint16_t and unsigned char with uint8_t.  Make li_line_base
an int8_t.
* dwarf.c (display_debug_lines_raw): Revert "adv" back to an int.
binutils/dwarf.c
binutils/dwarf.h