gdb, dwarf: add assert to dwarf2_get_pc_bounds

In dwarf2_get_pc_bounds we were writing unchecked to *lowpc.  This
commit adds a gdb_assert to first check that lowpc != nullptr.

Approved-by: Tom Tromey <tom@tromey.com>
This commit is contained in:
Nils-Christian Kempke 2022-07-13 11:23:36 +02:00 committed by Ijaz, Abdul B
parent 69570475c6
commit 06740cf11f

View file

@ -11092,6 +11092,7 @@ dwarf2_get_pc_bounds (struct die_info *die, unrelocated_addr *lowpc,
&& !per_objfile->per_bfd->has_section_at_zero)
return PC_BOUNDS_INVALID;
gdb_assert (lowpc != nullptr);
*lowpc = low;
if (highpc != nullptr)
*highpc = high;