aboutsummaryrefslogtreecommitdiff
path: root/libdw/dwarf_ranges.c
diff options
context:
space:
mode:
Diffstat (limited to 'libdw/dwarf_ranges.c')
-rw-r--r--libdw/dwarf_ranges.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libdw/dwarf_ranges.c b/libdw/dwarf_ranges.c
index 520f9ffe..b853e4b9 100644
--- a/libdw/dwarf_ranges.c
+++ b/libdw/dwarf_ranges.c
@@ -489,10 +489,10 @@ dwarf_ranges (Dwarf_Die *die, ptrdiff_t offset, Dwarf_Addr *basep,
size_t secidx = (cu->version < 5 ? IDX_debug_ranges : IDX_debug_rnglists);
const Elf_Data *d = cu->dbg->sectiondata[secidx];
- if (d == NULL && cu->unit_type == DW_UT_split_compile)
+ if (cu->unit_type == DW_UT_split_compile && (d == NULL || is_cudie (die)))
{
Dwarf_CU *skel = __libdw_find_split_unit (cu);
- if (skel != NULL)
+ if (skel != NULL && skel->dbg->sectiondata[secidx] != NULL)
{
cu = skel;
d = cu->dbg->sectiondata[secidx];