From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 103648 invoked by alias); 26 Oct 2018 16:30:59 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 103501 invoked by uid 89); 26 Oct 2018 16:30:49 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 26 Oct 2018 16:30:46 +0000 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2029F300294D for ; Fri, 26 Oct 2018 16:30:35 +0000 (UTC) Received: from localhost (unused-10-15-17-196.yyz.redhat.com [10.15.17.196]) by smtp.corp.redhat.com (Postfix) with ESMTP id E9F046013A; Fri, 26 Oct 2018 16:30:34 +0000 (UTC) From: Sergio Durigan Junior To: Kevin Buettner Cc: gdb-patches@sourceware.org Subject: Re: [PATCH] Fix thinko on common/offset-type.h (compare 'lhs' against 'rhs') References: <20181025211008.12164-1-sergiodj@redhat.com> <20181025210312.143b91aa@pinnacle.lan> Date: Fri, 26 Oct 2018 16:30:00 -0000 In-Reply-To: <20181025210312.143b91aa@pinnacle.lan> (Kevin Buettner's message of "Thu, 25 Oct 2018 21:03:12 -0700") Message-ID: <87k1m4eklx.fsf@redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes X-SW-Source: 2018-10/txt/msg00626.txt.bz2 On Friday, October 26 2018, Kevin Buettner wrote: > On Thu, 25 Oct 2018 17:10:08 -0400 > Sergio Durigan Junior 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 >> >> * 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.) Thanks for the review, Kevin. According to my discussion with Simon, the proposed approach (for which I'll submit a new patch soon) is to entirely remove the overloads for relational operators, since they're clearly not being used. Thanks, -- Sergio GPG key ID: 237A 54B1 0287 28BF 00EF 31F4 D0EB 7628 65FC 5E36 Please send encrypted e-mail if possible http://sergiodj.net/