2009-10-22 Paul Pluzhnikov <ppluzhnikov@google.com>

PR gdb/10819
	* dwarf2-frame.c (find_cie): Don't call bsearch on empty cie_table.
	* objfiles.c (find_pc_section): Likewise.
	(update_section_map): Don't allocate empty table.
This commit is contained in:
Paul Pluzhnikov
2009-10-22 20:20:27 +00:00
parent 02506ff1ad
commit 65a97ab329
3 changed files with 31 additions and 0 deletions

View File

@@ -1525,6 +1525,14 @@ find_cie (struct dwarf2_cie_table *cie_table, ULONGEST cie_pointer)
{
struct dwarf2_cie **p_cie;
/* The C standard (ISO/IEC 9899:TC2) requires the BASE argument to
bsearch be non-NULL. */
if (cie_table->entries == NULL)
{
gdb_assert (cie_table->num_entries == 0);
return NULL;
}
p_cie = bsearch (&cie_pointer, cie_table->entries, cie_table->num_entries,
sizeof (cie_table->entries[0]), bsearch_cie_cmp);
if (p_cie != NULL)