diff options
| author | Roland McGrath <[email protected]> | 2007-10-23 13:07:39 +0000 |
|---|---|---|
| committer | Roland McGrath <[email protected]> | 2007-10-23 13:07:39 +0000 |
| commit | e4c22ea004c02a58f5db5eb53794275344c17958 (patch) | |
| tree | ec3713d305f8e9f05b15d29240accc71e98998c5 /libdw/dwarf_child.c | |
| parent | 98c5ead4ad9fbf96ad3b54d8ca26e354ddc3398d (diff) | |
2007-10-23 Roland McGrath <[email protected]>
* linux-kernel-modules.c (report_kernel_archive): Reorder the kernel
module to appear first.
Diffstat (limited to 'libdw/dwarf_child.c')
| -rw-r--r-- | libdw/dwarf_child.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/libdw/dwarf_child.c b/libdw/dwarf_child.c index 42b38137..b22b010e 100644 --- a/libdw/dwarf_child.c +++ b/libdw/dwarf_child.c @@ -1,5 +1,5 @@ /* Return vhild of current DIE. - Copyright (C) 2003, 2004, 2005, 2006 Red Hat, Inc. + Copyright (C) 2003, 2004, 2005, 2006, 2007 Red Hat, Inc. This file is part of Red Hat elfutils. Written by Ulrich Drepper <[email protected]>, 2003. @@ -177,6 +177,15 @@ dwarf_child (die, result) if (addr == NULL) return -1; + /* It's kosher (just suboptimal) to have a null entry first thing (7.5.3). + So if this starts with ULEB128 of 0 (even with silly encoding of 0), + it is a kosher null entry and we do not really have any children. */ + const unsigned char *code = addr; + while (unlikely (*code == 0x80)) + ++code; + if (unlikely (*code == '\0')) + return 1; + /* RESULT can be the same as DIE. So preserve what we need. */ struct Dwarf_CU *cu = die->cu; |
