diff options
Diffstat (limited to 'gdb/dwarf2')
-rw-r--r-- | gdb/dwarf2/read.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c index 64cf5f4..d583030 100644 --- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c @@ -7162,8 +7162,11 @@ cutu_reader::keep () gdb_assert (!dummy_p); if (m_new_cu != NULL) { - struct dwarf2_per_objfile *dwarf2_per_objfile - = m_this_cu->dwarf2_per_objfile; + /* We know that m_this_cu->cu is set, since we are in the process of + parsing the CU. */ + gdb_assert (m_this_cu->cu != nullptr); + dwarf2_per_objfile *dwarf2_per_objfile = m_this_cu->cu->per_objfile; + /* Link this CU into read_in_chain. */ m_this_cu->cu->read_in_chain = dwarf2_per_objfile->per_bfd->read_in_chain; dwarf2_per_objfile->per_bfd->read_in_chain = m_this_cu; |