asan: NULL deref in scan_unit_for_symbols
authorAlan Modra <amodra@gmail.com>
Wed, 1 Jun 2022 07:22:58 +0000 (16:52 +0930)
committerAlan Modra <amodra@gmail.com>
Thu, 2 Jun 2022 06:24:14 +0000 (15:54 +0930)
commitb3abcebcae6e648086147637bcba09c217c8bd9a
treedc8a02a56b850c477ca77d42310383918e9627fb
parenta115b2793459e25d8fa5be3dc1c69dcab0a32e53
asan: NULL deref in scan_unit_for_symbols

Since commit b43771b045 it has been possible to look up addresses
that match a unit with errors, since ranges are added to a trie while
the unit is being parsed.  On error, parse_comp_unit leaves
first_child_die_ptr NULL which results in a NULL info_ptr being passed
to scan_unit_for_symbols.  Fix this by setting unit->error.

Also wrap some overlong lines, and fix some formatting errors.

* dwarf2.c: Formatting.
(parse_comp_unit): Set unit->error on err_exit path.
bfd/dwarf2.c