summaryrefslogtreecommitdiffstats
path: root/libdw/dwarf_getsrclines.c
diff options
context:
space:
mode:
authorPetr Machata <[email protected]>2015-04-01 21:44:32 +0200
committerPetr Machata <[email protected]>2015-04-03 13:21:09 +0200
commit71de1d2a8a3fffc83c707642a24f350d7217f83c (patch)
treed6a0107cf2b7990fded43f0fc66d2cd00d84ff62 /libdw/dwarf_getsrclines.c
parent224e2e61b25eed8d320a286bbbd12f9ea4a7799e (diff)
Do not reject type units in dwarf_getsrcfiles and dwarf_getsrclines
Signed-off-by: Petr Machata <[email protected]>
Diffstat (limited to 'libdw/dwarf_getsrclines.c')
-rw-r--r--libdw/dwarf_getsrclines.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/libdw/dwarf_getsrclines.c b/libdw/dwarf_getsrclines.c
index 053b30f2..368f2fd8 100644
--- a/libdw/dwarf_getsrclines.c
+++ b/libdw/dwarf_getsrclines.c
@@ -1,5 +1,5 @@
/* Return line number information of CU.
- Copyright (C) 2004-2010, 2013, 2014 Red Hat, Inc.
+ Copyright (C) 2004-2010, 2013, 2014, 2015 Red Hat, Inc.
This file is part of elfutils.
Written by Ulrich Drepper <[email protected]>, 2004.
@@ -838,10 +838,13 @@ __libdw_getcompdir (Dwarf_Die *cudie)
int
dwarf_getsrclines (Dwarf_Die *cudie, Dwarf_Lines **lines, size_t *nlines)
{
- if (unlikely (cudie == NULL
- || (INTUSE(dwarf_tag) (cudie) != DW_TAG_compile_unit
- && INTUSE(dwarf_tag) (cudie) != DW_TAG_partial_unit)))
+ if (cudie == NULL)
return -1;
+ if (! is_cudie (cudie))
+ {
+ __libdw_seterrno (DWARF_E_NOT_CUDIE);
+ return -1;
+ }
/* Get the information if it is not already known. */
struct Dwarf_CU *const cu = cudie->cu;