+2012-10-08 Jan Kratochvil <jan.kratochvil@redhat.com>
+
+ * fde.c (__libdw_find_fde): Change <fde != NULL> to likely. Return
+ DWARF_E_NO_MATCH if .eh_frame_hdr points to FDE which is too short for
+ searched PC.
+
2012-10-08 Jan Kratochvil <jan.kratochvil@redhat.com>
* dwarf_getlocation.c (__libdw_intern_expression) <cfap>: Make new
if (offset == (Dwarf_Off) -1l)
goto no_match;
struct dwarf_fde *fde = __libdw_fde_by_offset (cache, offset);
- if (unlikely (fde != NULL)
- /* Sanity check the address range. */
- && unlikely (address < fde->start || address >= fde->end))
+ if (likely (fde != NULL))
{
- __libdw_seterrno (DWARF_E_INVALID_DWARF);
- return NULL;
+ /* Sanity check the address range. */
+ if (unlikely (address < fde->start))
+ {
+ __libdw_seterrno (DWARF_E_INVALID_DWARF);
+ return NULL;
+ }
+ /* .eh_frame_hdr does not indicate length covered by FDE. */
+ if (unlikely (address >= fde->end))
+ goto no_match;
}
return fde;
}