Fix case where struct is None
authorStanislas P1kachu Lejay <p1kachu@lse.epita.fr>
Sun, 19 Jun 2016 12:12:41 +0000 (14:12 +0200)
committerStanislas P1kachu Lejay <p1kachu@lse.epita.fr>
Sun, 19 Jun 2016 12:12:41 +0000 (14:12 +0200)
Signed-off-by: Stanislas P1kachu Lejay <p1kachu@lse.epita.fr>
elftools/dwarf/dwarfinfo.py

index 1995fc88f772efe9a169e058e6e3fc1712c6242a..5a5c41ad263acc6baf6632fa5070646d57426fae 100644 (file)
@@ -191,6 +191,9 @@ class DWARFInfo(object):
     def _parse_CUs_iter(self):
         """ Parse CU entries from debug_info. Yield CUs in order of appearance.
         """
+        if self.debug_info_sec is None:
+            return
+
         offset = 0
         while offset < self.debug_info_sec.size:
             cu = self._parse_CU_at_offset(offset)