From: Tom de Vries Date: Fri, 18 Jun 2021 12:29:42 +0000 (+0200) Subject: [gdb/symtab] Simplify child_die loop in read_file_scope X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b117f32220fc2cd734d17f62e0cc3a6d909e3d76;p=thirdparty%2Fbinutils-gdb.git [gdb/symtab] Simplify child_die loop in read_file_scope --- diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c index 07bc08fba14..16103e617d2 100644 --- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c @@ -10531,15 +10531,10 @@ read_file_scope (struct die_info *die, struct dwarf2_cu *cu) handle_DW_AT_stmt_list (die, cu, fnd.comp_dir, lowpc); /* Process all dies in compilation unit. */ - if (die->child != NULL) - { - child_die = die->child; - while (child_die && child_die->tag) - { - process_die (child_die, cu); - child_die = child_die->sibling; - } - } + for (child_die = die->child; child_die != nullptr && child_die->tag != 0; + child_die = child_die->sibling) + process_die (child_die, cu); + per_objfile->sym_cu = nullptr; /* Decode macro information, if present. Dwarf 2 macro information