summaryrefslogtreecommitdiffstats
path: root/libdw/dwarf_ranges.c
diff options
context:
space:
mode:
authorRoland McGrath <[email protected]>2007-04-05 09:27:36 +0000
committerRoland McGrath <[email protected]>2007-04-05 09:27:36 +0000
commitbf2ee480165faec726d678f189acd2bd54e07573 (patch)
tree4f06b12c523ebaf14aac84ac84db8d353f2a8f86 /libdw/dwarf_ranges.c
parent5f6a41a8484d110cb38b0989a3a240dc28fd7310 (diff)
libdw/
2007-04-05 Roland McGrath <[email protected]> * dwarf_ranges.c (dwarf_ranges): Don't sign-extend 32-bit BEGIN address to check for all-ones base address entry. Check directly. Reported by SĂ©bastien DuguĂ© <[email protected]>.
Diffstat (limited to 'libdw/dwarf_ranges.c')
-rw-r--r--libdw/dwarf_ranges.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/libdw/dwarf_ranges.c b/libdw/dwarf_ranges.c
index 57788da0..89da0af4 100644
--- a/libdw/dwarf_ranges.c
+++ b/libdw/dwarf_ranges.c
@@ -1,5 +1,5 @@
/* Enumerate the PC ranges covered by a DIE.
- Copyright (C) 2005 Red Hat, Inc.
+ Copyright (C) 2005, 2007 Red Hat, Inc.
This file is part of Red Hat elfutils.
Red Hat elfutils is free software; you can redistribute it and/or modify
@@ -141,18 +141,21 @@ dwarf_ranges (Dwarf_Die *die, ptrdiff_t offset, Dwarf_Addr *basep,
{
begin = read_8ubyte_unaligned_inc (die->cu->dbg, readp);
end = read_8ubyte_unaligned_inc (die->cu->dbg, readp);
+ if (begin == (uint64_t) -1l) /* Base address entry. */
+ {
+ *basep = end;
+ goto next;
+ }
}
else
{
- begin = (Dwarf_Sword) read_4sbyte_unaligned_inc (die->cu->dbg,
- readp);
+ begin = read_4ubyte_unaligned_inc (die->cu->dbg, readp);
end = read_4ubyte_unaligned_inc (die->cu->dbg, readp);
- }
-
- if (begin == (Dwarf_Addr) -1l) /* Base address entry. */
- {
- *basep = end;
- goto next;
+ if (begin == (uint32_t) -1) /* Base address entry. */
+ {
+ *basep = end;
+ goto next;
+ }
}
if (begin == 0 && end == 0) /* End of list entry. */