mirror of
https://github.com/openharmony/third_party_elfutils.git
synced 2026-07-19 19:43:34 -04:00
libdw: Make __libdw_dieabbrev more robust on failure.
Make sure to always set die->abbrev to DWARF_END_ABBREV on failure. DWARF_END_ABBREV is also what the function reports on failure. And it will prevent trying to lookup the abbrev ever again. Signed-off-by: Mark Wielaard <mark@klomp.org>
This commit is contained in:
@@ -1,3 +1,8 @@
|
||||
2018-06-12 Mark Wielaard <mark@klomp.org>
|
||||
|
||||
* libdw.h (__libdw_dieabbrev): Set die->abbrev to DWARF_END_ABBREV
|
||||
on failure.
|
||||
|
||||
2018-06-10 Mark Wielaard <mark@klomp.org>
|
||||
|
||||
* dwarf_attr_integrate.c (dwarf_attr_integrate): Stop after 16 DIE
|
||||
|
||||
+3
-2
@@ -653,8 +653,9 @@ __libdw_dieabbrev (Dwarf_Die *die, const unsigned char **readp)
|
||||
/* Get the abbreviation code. */
|
||||
unsigned int code;
|
||||
const unsigned char *addr = die->addr;
|
||||
if (die->cu == NULL || addr >= (const unsigned char *) die->cu->endp)
|
||||
return DWARF_END_ABBREV;
|
||||
if (unlikely (die->cu == NULL
|
||||
|| addr >= (const unsigned char *) die->cu->endp))
|
||||
return die->abbrev = DWARF_END_ABBREV;
|
||||
get_uleb128 (code, addr, die->cu->endp);
|
||||
if (readp != NULL)
|
||||
*readp = addr;
|
||||
|
||||
Reference in New Issue
Block a user