[2/7] Don't check abbrev is NULL in read_partial_die

Message ID 1519313796-2397-3-git-send-email-yao.qi@linaro.org
State New
Headers show
Series
  • Class-fy partial_die_info
Related show

Commit Message

Yao Qi Feb. 22, 2018, 3:36 p.m.
'abbrev' won't be NULL, so don't check it.

gdb:

2018-01-11  Yao Qi  <yao.qi@linaro.org>

	* dwarf2read.c (read_partial_die): Remove the code checking abbrev
	is NULL.
---
 gdb/dwarf2read.c | 3 ---
 1 file changed, 3 deletions(-)

-- 
1.9.1

Comments

Simon Marchi Feb. 25, 2018, 11:33 p.m. | #1
On 2018-02-22 10:36 AM, Yao Qi wrote:
> 'abbrev' won't be NULL, so don't check it.

> 

> gdb:


I would suggest changing abbrev type to a const reference then.

Simon

Patch

diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index 81b42cf..147c7ca 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -18503,9 +18503,6 @@  read_partial_die (const struct die_reader_specs *reader,
 
   info_ptr += abbrev_len;
 
-  if (abbrev == NULL)
-    return info_ptr;
-
   part_die->tag = abbrev->tag;
   part_die->has_children = abbrev->has_children;