]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
Handle it specially when dwarf_ranges returns 1
authorPetr Machata <pmachata@redhat.com>
Mon, 2 Feb 2009 16:32:03 +0000 (17:32 +0100)
committerPetr Machata <pmachata@redhat.com>
Mon, 2 Feb 2009 16:32:03 +0000 (17:32 +0100)
libdw/c++/dwarf

index 9ceb4b40a964fa8a151ceb3d762bcee87dc2e8a3..c241a134056836cbba76540f497b6c69e8ba3d18 100644 (file)
@@ -1729,10 +1729,20 @@ namespace elfutils
        const_iterator &operator++ () // prefix
        {
          do
-           _m_offset = dwarf_ranges (_m_die.thisdie (), _m_offset,
-                                     &_m_base, &_m_begin, &_m_end);
+           {
+             _m_offset = dwarf_ranges (_m_die.thisdie (), _m_offset,
+                                       &_m_base, &_m_begin, &_m_end);
+
+             // Special case: no ranges to look for.
+             if (_m_offset == 1)
+               {
+                 _m_offset = 0;
+                 break;
+               }
+           }
          // Skip over empty ranges.
          while (_m_offset != 0 && _m_begin == _m_end);
+
          return *this;
        }
        inline const_iterator operator++ (int) // postfix