[llvm-branch-commits] [lldb] r347030 - Merging r344605:

Tom Stellard via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Thu Nov 15 22:04:28 PST 2018


Author: tstellar
Date: Thu Nov 15 22:04:28 2018
New Revision: 347030

URL: http://llvm.org/viewvc/llvm-project?rev=347030&view=rev
Log:
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

------------------------------------------------------------------------

Modified:
    lldb/branches/release_70/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp

Modified: lldb/branches/release_70/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/release_70/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp?rev=347030&r1=347029&r2=347030&view=diff
==============================================================================
--- lldb/branches/release_70/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp (original)
+++ lldb/branches/release_70/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp Thu Nov 15 22:04:28 2018
@@ -261,7 +261,11 @@ void DWARFUnit::ExtractDIEsRWLocked() {
   }
 
   if (!m_die_array.empty()) {
-    lldbassert(!m_first_die || m_first_die == m_die_array.front());
+    if (m_first_die) {
+      // Only needed for the assertion.
+      m_first_die.SetEmptyChildren(m_die_array.front().GetEmptyChildren());
+      lldbassert(m_first_die == m_die_array.front());
+    }
     m_first_die = m_die_array.front();
   }
 




More information about the llvm-branch-commits mailing list