Skip to content

Commit 85e1cc5

Browse files
committed
Merging r344605:
------------------------------------------------------------------------ r344605 | jankratochvil | 2018-10-16 04:38:22 -0700 (Tue, 16 Oct 2018) | 12 lines Fix: Assertion failed: (!m_first_die || m_first_die == m_die_array.front()), function ExtractDIEsRWLocked xbolva00 bugreported $subj in: https://reviews.llvm.org/D46810#1247410 It can happen only from the line: m_die_array.back().SetEmptyChildren(true); In the case DW_TAG_compile_unit has DW_CHILDREN_yes but there is only 0 (end of list, no children present). Therefore the assertion can fortunately happen only with a hand-crafted DWARF or with DWARF from some suboptimal compilers. Differential Revision: https://reviews.llvm.org/D53255 ------------------------------------------------------------------------ llvm-svn: 347030
1 parent 35aa48a commit 85e1cc5

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,11 @@ void DWARFUnit::ExtractDIEsRWLocked() {
261261
}
262262

263263
if (!m_die_array.empty()) {
264-
lldbassert(!m_first_die || m_first_die == m_die_array.front());
264+
if (m_first_die) {
265+
// Only needed for the assertion.
266+
m_first_die.SetEmptyChildren(m_die_array.front().GetEmptyChildren());
267+
lldbassert(m_first_die == m_die_array.front());
268+
}
265269
m_first_die = m_die_array.front();
266270
}
267271

0 commit comments

Comments
 (0)