Patchwork [FYI] Remove redundant assignment from dwarf2_find_containing_comp_unit

login
register
mail settings
Submitter Tom Tromey
Date March 11, 2019, 4:23 p.m.
Message ID <20190311162352.17397-1-tromey@adacore.com>
Download mbox | patch
Permalink /patch/31816/
State New
Headers show

Comments

Tom Tromey - March 11, 2019, 4:23 p.m.
dwarf2_find_containing_comp_unit has two assignments to "this_cu" in
quick succession, both of which are just:

  this_cu = dwarf2_per_objfile->all_comp_units[low];

... with no intervening assignments.

This patch removes the second assignment.  I'm checking this in as
obvious.  Tested on x86-64 Fedora 29.

gdb/ChangeLog
2019-03-11  Tom Tromey  <tromey@adacore.com>

	* dwarf2read.c (dwarf2_find_containing_comp_unit): Remove
	redundant assignment to "this_cu".
---
 gdb/ChangeLog    | 5 +++++
 gdb/dwarf2read.c | 1 -
 2 files changed, 5 insertions(+), 1 deletion(-)

Patch

diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index 0c59dcd2042..7c07a10e8c0 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -25157,7 +25157,6 @@  dwarf2_find_containing_comp_unit (sect_offset sect_off,
     }
   else
     {
-      this_cu = dwarf2_per_objfile->all_comp_units[low];
       if (low == dwarf2_per_objfile->all_comp_units.size () - 1
 	  && sect_off >= this_cu->sect_off + this_cu->length)
 	error (_("invalid dwarf2 offset %s"), sect_offset_str (sect_off));