From: Roland McGrath Date: Wed, 16 Jun 2010 09:21:26 +0000 (-0700) Subject: Check for CIE initial instructions that bogusly change the PC. X-Git-Tag: elfutils-0.148~20 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c70ebc0587ad1c549a3fe7f16a563bf4d6782aa7;p=thirdparty%2Felfutils.git Check for CIE initial instructions that bogusly change the PC. --- diff --git a/libdw/ChangeLog b/libdw/ChangeLog index edb7cbff8..18a423e55 100644 --- a/libdw/ChangeLog +++ b/libdw/ChangeLog @@ -1,3 +1,8 @@ +2010-06-16 Roland McGrath + + * cfi.c (execute_cfi): Barf on CIE initial instructions changing the + address. + 2010-06-15 Roland McGrath * dwarf_formref.c (__libdw_formref): Diagnose DW_FORM_ref_sig8 like diff --git a/libdw/cfi.c b/libdw/cfi.c index 3cb378b6d..aeb48e697 100644 --- a/libdw/cfi.c +++ b/libdw/cfi.c @@ -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; diff --git a/libdw/dwarf_next_cfi.c b/libdw/dwarf_next_cfi.c index 1ffa66998..fa7d09a75 100644 --- a/libdw/dwarf_next_cfi.c +++ b/libdw/dwarf_next_cfi.c @@ -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))