Check for CIE initial instructions that bogusly change the PC.
authorRoland McGrath <roland@redhat.com>
Wed, 16 Jun 2010 09:21:26 +0000 (02:21 -0700)
committerRoland McGrath <roland@redhat.com>
Wed, 16 Jun 2010 09:21:26 +0000 (02:21 -0700)
libdw/ChangeLog
libdw/cfi.c
libdw/dwarf_next_cfi.c

index edb7cbf..18a423e 100644 (file)
@@ -1,3 +1,8 @@
+2010-06-16  Roland McGrath  <roland@redhat.com>
+
+       * cfi.c (execute_cfi): Barf on CIE initial instructions changing the
+       address.
+
 2010-06-15  Roland McGrath  <roland@redhat.com>
 
        * dwarf_formref.c (__libdw_formref): Diagnose DW_FORM_ref_sig8 like
index 3cb378b..aeb48e6 100644 (file)
@@ -369,6 +369,7 @@ execute_cfi (Dwarf_CFI *cache,
        }
 
       /* We get here only for the cases that have just moved LOC.  */
+      cfi_assert (cie->initial_state != NULL);
       if (find_pc >= loc)
        /* This advance has not yet reached FIND_PC.  */
        fs->start = loc;
index 1ffa669..fa7d09a 100644 (file)
@@ -156,8 +156,8 @@ dwarf_next_cfi (e_ident, data, eh_frame_p, off, next_off, entry)
       ++bytes;
 
       /* The address size for CFI is implicit in the ELF class.  */
-      unsigned int address_size = e_ident[EI_CLASS] == ELFCLASS32 ? 4 : 8;
-      unsigned int segment_size = 0;
+      uint_fast8_t address_size = e_ident[EI_CLASS] == ELFCLASS32 ? 4 : 8;
+      uint_fast8_t segment_size = 0;
       if (version >= 4)
        {
          if (unlikely (limit - bytes < 5))