diff options
author | Philippe Waroquiers <philippe.waroquiers@skynet.be> | 2019-01-12 07:37:36 +0100 |
---|---|---|
committer | Philippe Waroquiers <philippe.waroquiers@skynet.be> | 2019-01-12 07:40:46 +0100 |
commit | 9d7c67bfbde3b948704b46f8a6fd479e98ecf2c8 (patch) | |
tree | 0804132a16e3218b2d897ff4c46046a3c806bfdc /gdb/symtab.c | |
parent | 7d62943cd492bb502f0d335cc695be15ae50cea3 (diff) | |
download | gdb-9d7c67bfbde3b948704b46f8a6fd479e98ecf2c8.zip gdb-9d7c67bfbde3b948704b46f8a6fd479e98ecf2c8.tar.gz gdb-9d7c67bfbde3b948704b46f8a6fd479e98ecf2c8.tar.bz2 |
Fix 'obj' may be used uninitialized warning in symtab.c:matching_obj_sections.
Fix warning:
gdb/symtab.c: In function ‘int matching_obj_sections(obj_section*, obj_section*)’:
gdb/symtab.c:1024:12: warning: ‘obj’ may be used uninitialized in this function [-Wmaybe-uninitialized]
if (obj->separate_debug_objfile_backlink != NULL
2019-01-12 Philippe Waroquiers <philippe.waroquiers@skynet.be>
* symtab.c (matching_obj_sections): Initialize obj,
declare it closer to its usage.
Diffstat (limited to 'gdb/symtab.c')
-rw-r--r-- | gdb/symtab.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gdb/symtab.c b/gdb/symtab.c index d5e18a6..29b2432 100644 --- a/gdb/symtab.c +++ b/gdb/symtab.c @@ -970,7 +970,6 @@ matching_obj_sections (struct obj_section *obj_first, { asection *first = obj_first? obj_first->the_bfd_section : NULL; asection *second = obj_second? obj_second->the_bfd_section : NULL; - struct objfile *obj; /* If they're the same section, then they match. */ if (first == second) @@ -1010,6 +1009,7 @@ matching_obj_sections (struct obj_section *obj_first, /* Otherwise check that they are in corresponding objfiles. */ + struct objfile *obj = NULL; for (objfile *objfile : all_objfiles (current_program_space)) if (objfile->obfd == first->owner) { |