mirror of
https://github.com/FEX-Emu/libunwind.git
synced 2024-11-30 18:00:59 +00:00
dwarf: check maps_init result
This fixes GCC 4.9.3 warnings (Linux/mipsel): dwarf/Gfind_proc_info-lsb.c: In function 'locate_debug_info': dwarf/Gfind_proc_info-lsb.c:244:23: warning: 'mi.buf_end' may be used uninitialized in this function [-Wmaybe-uninitialized] struct map_iterator mi; ^ dwarf/Gfind_proc_info-lsb.c:244:23: warning: 'mi.buf' may be used uninitialized in this function [-Wmaybe-uninitialized] In file included from dwarf/Gfind_proc_info-lsb.c:46:0: ./os-linux.h:292:27: warning: 'mi.buf_size' may be used uninitialized in this function [-Wmaybe-uninitialized] munmap (mi->buf_end - mi->buf_size, mi->buf_size); ^ dwarf/Gfind_proc_info-lsb.c:244:23: note: 'mi.buf_size' was declared here struct map_iterator mi; ^
This commit is contained in:
parent
0326f1048a
commit
ad0d7633bc
@ -246,7 +246,9 @@ find_binary_for_address (unw_word_t ip, char *name, size_t name_size)
|
||||
int pid = getpid ();
|
||||
unsigned long segbase, mapoff, hi;
|
||||
|
||||
maps_init (&mi, pid);
|
||||
if (maps_init (&mi, pid) != 0)
|
||||
return 1;
|
||||
|
||||
while (maps_next (&mi, &segbase, &hi, &mapoff))
|
||||
if (ip >= segbase && ip < hi)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user