From 06740cf11f601c6a5a0f3807f37aaac31d13a542 Mon Sep 17 00:00:00 2001 From: Nils-Christian Kempke Date: Wed, 13 Jul 2022 11:23:36 +0200 Subject: 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 --- gdb/dwarf2/read.c | 1 + 1 file changed, 1 insertion(+) (limited to 'gdb') diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c index 59a6500..6d95874 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; -- cgit v1.1