From: Nils-Christian Kempke Date: Wed, 13 Jul 2022 09:23:36 +0000 (+0200) Subject: gdb, dwarf: add assert to dwarf2_get_pc_bounds X-Git-Tag: binutils-2_42~341 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=06740cf11f601c6a5a0f3807f37aaac31d13a542;p=thirdparty%2Fbinutils-gdb.git 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 --- diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c index 59a65007575..6d958744461 100644 --- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c @@ -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;