* dwarf2read.c (dwarf2_ranges_read): Skip empty range entries.

Complain about inverted range entries.
	(dwarf2_record_block_ranges): Likewise.
This commit is contained in:
Ulrich Weigand 2011-02-04 18:13:25 +00:00
parent a3be78903d
commit 9277c30c29
2 changed files with 32 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2011-02-04 Ulrich Weigand <ulrich.weigand@linaro.org>
* dwarf2read.c (dwarf2_ranges_read): Skip empty range entries.
Complain about inverted range entries.
(dwarf2_record_block_ranges): Likewise.
2011-02-04 Thiago Jung Bauermann <bauerman@br.ibm.com>
Fix some typos.

View File

@ -5863,10 +5863,22 @@ dwarf2_ranges_read (unsigned offset, CORE_ADDR *low_return,
return 0;
}
if (range_beginning > range_end)
{
/* Inverted range entries are invalid. */
complaint (&symfile_complaints,
_("Invalid .debug_ranges data (inverted range)"));
return 0;
}
/* Empty range entries have no effect. */
if (range_beginning == range_end)
continue;
range_beginning += base;
range_end += base;
if (ranges_pst != NULL && range_beginning < range_end)
if (ranges_pst != NULL)
addrmap_set_empty (objfile->psymtabs_addrmap,
range_beginning + baseaddr,
range_end - 1 + baseaddr,
@ -6149,6 +6161,19 @@ dwarf2_record_block_ranges (struct die_info *die, struct block *block,
return;
}
if (start > end)
{
/* Inverted range entries are invalid. */
complaint (&symfile_complaints,
_("Invalid .debug_ranges data "
"(inverted range)"));
return;
}
/* Empty range entries have no effect. */
if (start == end)
continue;
record_block_range (block,
baseaddr + base + start,
baseaddr + base + end - 1);