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]

RFA: Fix assertion on replace_types()


Hi Guys,

  Compiling GDB with gcc version 6.1.1 from the about to be released
  Fedora 24 produces a warning/error about a redundant comparison in
  gdbtypes.c:replace_types().  The fix appears obvious to me, but since
  I am not a regular contributor, I thought that I had better check here
  first.

  OK to apply ?
  
Cheers
  Nick

gdb/ChangeLog
2016-06-13  Nick Clifton  <nickc@redhat.com>

	* gdbtypes.c (replace_type): Fix assertion.

diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
index 48f2cd3..0421cc5 100644
--- a/gdb/gdbtypes.c
+++ b/gdb/gdbtypes.c
@@ -756,7 +756,7 @@ replace_type (struct type *ntype, struct type *type)
      the assignment of one type's main type structure to the other
      will produce a type with references to objects (names; field
      lists; etc.) allocated on an objfile other than its own.  */
-  gdb_assert (TYPE_OBJFILE (ntype) == TYPE_OBJFILE (ntype));
+  gdb_assert (TYPE_OBJFILE (ntype) == TYPE_OBJFILE (type));
 
   *TYPE_MAIN_TYPE (ntype) = *TYPE_MAIN_TYPE (type);
 


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