This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Fix thinko on common/offset-type.h (compare 'lhs' against 'rhs')
- From: Kevin Buettner <kevinb at redhat dot com>
- To: gdb-patches at sourceware dot org
- Cc: Sergio Durigan Junior <sergiodj at redhat dot com>
- Date: Thu, 25 Oct 2018 21:03:12 -0700
- Subject: Re: [PATCH] Fix thinko on common/offset-type.h (compare 'lhs' against 'rhs')
- References: <20181025211008.12164-1-sergiodj@redhat.com>
On Thu, 25 Oct 2018 17:10:08 -0400
Sergio Durigan Junior <sergiodj@redhat.com> wrote:
> While doing something else, I noticed that the OFFSET_TYPE's
> "DEFINE_OFFSET_REL_OP" has a thinko: it is comparing 'lhs' against
> itself, instead of against 'rhs'. This patch fixes it.
>
> I also found an interesting thing. We have an unittest for
> offset-type, and in theory it should have caught this problem, because
> it has tests for relational operators. However, the tests
> successfully pass, and after some investigation I'm almost sure this
> is because these operators are not being properly overloaded. I tried
> a few things to make them be used, without success. If someone wants
> to give this a try, I'd appreciate.
>
> No regressions introduced.
>
> gdb/ChangeLog:
> 2018-10-25 Sergio Durigan Junior <sergiodj@redhat.com>
>
> * common/offset-type.h (DEFINE_OFFSET_REL_OP): Compare 'lhs'
> against 'rhs', instead of with 'lhs' again.
LGTM.
(I'm surprised that it wasn't caught by the unit test or by someone
else noticing a bug elsewhere in GDB.)
Kevin