dwarf_loader: Properly initialize ->size in lexblock__init

When dwarf_lowpc failed we were not initializing ->size, so garbage was
being left there and thing like 'pfunct --sizes' were producing
senseless results.

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
Arnaldo Carvalho de Melo 2009-09-20 16:53:19 -03:00
parent 5859ddcbf1
commit 0412efb401
1 changed files with 3 additions and 2 deletions

View File

@ -755,9 +755,10 @@ static void lexblock__init(struct lexblock *self, struct cu *cu,
{
Dwarf_Off high_pc;
if (!cu->has_addr_info || dwarf_lowpc(die, &self->ip.addr))
if (!cu->has_addr_info || dwarf_lowpc(die, &self->ip.addr)) {
self->ip.addr = 0;
else if (dwarf_highpc(die, &high_pc))
self->size = 0;
} else if (dwarf_highpc(die, &high_pc))
self->size = 0;
else
self->size = high_pc - self->ip.addr;