This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[commit] dwarf2read.c (load_cu): Move assert to more useful location.


Hi.

There's no point in asserting a pointer != NULL after you've
dereferenced it.

2012-01-01  Doug Evans  <dje@google.com>

	* dwarf2read.c (load_cu): Move assert to more useful location.

Index: dwarf2read.c
===================================================================
RCS file: /cvs/src/src/gdb/dwarf2read.c,v
retrieving revision 1.591
diff -u -p -r1.591 dwarf2read.c
--- dwarf2read.c	2 Jan 2012 00:23:50 -0000	1.591
+++ dwarf2read.c	2 Jan 2012 00:28:08 -0000
@@ -1833,9 +1833,9 @@ load_cu (struct dwarf2_per_cu_data *per_
   else
     load_full_comp_unit (per_cu, per_cu->objfile);
 
-  dwarf2_find_base_address (per_cu->cu->dies, per_cu->cu);
-
   gdb_assert (per_cu->cu != NULL);
+
+  dwarf2_find_base_address (per_cu->cu->dies, per_cu->cu);
 }
 
 /* Read in the symbols for PER_CU.  OBJFILE is the objfile from which


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]