Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* RFA: Fix assertion on replace_types()
@ 2016-06-13  9:41 Nick Clifton
  2016-06-13 10:21 ` Yao Qi
  0 siblings, 1 reply; 2+ messages in thread
From: Nick Clifton @ 2016-06-13  9:41 UTC (permalink / raw)
  To: gdb-patches

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);
 


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: RFA: Fix assertion on replace_types()
  2016-06-13  9:41 RFA: Fix assertion on replace_types() Nick Clifton
@ 2016-06-13 10:21 ` Yao Qi
  0 siblings, 0 replies; 2+ messages in thread
From: Yao Qi @ 2016-06-13 10:21 UTC (permalink / raw)
  To: Nick Clifton; +Cc: gdb-patches

On Mon, Jun 13, 2016 at 10:41 AM, Nick Clifton <nickc@redhat.com> wrote:
> 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 ?

Yes, it is OK.  The comments say two types should be in the same objfile,
so your fix is right to me.

-- 
Yao (齐尧)


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-06-13 10:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-13  9:41 RFA: Fix assertion on replace_types() Nick Clifton
2016-06-13 10:21 ` Yao Qi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox