RFA: Fix assertion on replace_types()
Commit Message
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.
Comments
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.
@@ -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);