Had to apply this patch so that DWARF works properly on executables generated 
by GCC on Windows (for CIE/FDE, data after the length should not be read if 
length is 0).

I suppose this should also apply on other platforms?

http://llvm-reviews.chandlerc.com/D1487

Files:
  source/Symbol/DWARFCallFrameInfo.cpp

Index: source/Symbol/DWARFCallFrameInfo.cpp
===================================================================
--- source/Symbol/DWARFCallFrameInfo.cpp
+++ source/Symbol/DWARFCallFrameInfo.cpp
@@ -341,7 +341,7 @@
         dw_offset_t next_entry = current_entry + len + 4;
         dw_offset_t cie_id = m_cfi_data.GetU32 (&offset);
 
-        if (cie_id == 0 || cie_id == UINT32_MAX)
+        if (cie_id == 0 || cie_id == UINT32_MAX || len == 0)
         {
             m_cie_map[current_entry] = ParseCIE (current_entry);
             offset = next_entry;
Index: source/Symbol/DWARFCallFrameInfo.cpp
===================================================================
--- source/Symbol/DWARFCallFrameInfo.cpp
+++ source/Symbol/DWARFCallFrameInfo.cpp
@@ -341,7 +341,7 @@
         dw_offset_t next_entry = current_entry + len + 4;
         dw_offset_t cie_id = m_cfi_data.GetU32 (&offset);
 
-        if (cie_id == 0 || cie_id == UINT32_MAX)
+        if (cie_id == 0 || cie_id == UINT32_MAX || len == 0)
         {
             m_cie_map[current_entry] = ParseCIE (current_entry);
             offset = next_entry;
_______________________________________________
lldb-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits

Reply via email to