aboutsummaryrefslogtreecommitdiff
path: root/libdw/dwarf_entrypc.c
diff options
context:
space:
mode:
Diffstat (limited to 'libdw/dwarf_entrypc.c')
-rw-r--r--libdw/dwarf_entrypc.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/libdw/dwarf_entrypc.c b/libdw/dwarf_entrypc.c
index 0ef3b0ea..543567d4 100644
--- a/libdw/dwarf_entrypc.c
+++ b/libdw/dwarf_entrypc.c
@@ -37,12 +37,10 @@
int
dwarf_entrypc (Dwarf_Die *die, Dwarf_Addr *return_addr)
{
- Dwarf_Attribute attr_mem;
-
- return INTUSE(dwarf_formaddr) (INTUSE(dwarf_attr) (die, DW_AT_entry_pc,
- &attr_mem)
- ?: INTUSE(dwarf_attr) (die, DW_AT_low_pc,
- &attr_mem),
- return_addr);
+ Dwarf_Attribute attr_mem, *attr;
+ if ((attr = INTUSE(dwarf_attr) (die, DW_AT_entry_pc, &attr_mem)) != NULL)
+ return INTUSE(dwarf_formaddr) (attr, return_addr);
+ else
+ return INTUSE(dwarf_lowpc) (die, return_addr);
}
INTDEF(dwarf_entrypc)