From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#65051: internal_equal manipulates symbols with position without checking symbols-with-pos-enabled. Date: Fri, 4 Aug 2023 14:59:58 +0000 Message-ID: References: <83leeqvpx8.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8931"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 65051@debbugs.gnu.org, acm@muc.de To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Aug 04 17:01:19 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qRwIp-00025F-AH for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 04 Aug 2023 17:01:19 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qRwIc-0006mb-9e; Fri, 04 Aug 2023 11:01:06 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qRwIZ-0006mE-JX for bug-gnu-emacs@gnu.org; Fri, 04 Aug 2023 11:01:03 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qRwIY-0004E7-5r for bug-gnu-emacs@gnu.org; Fri, 04 Aug 2023 11:01:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qRwIY-0001uP-1U for bug-gnu-emacs@gnu.org; Fri, 04 Aug 2023 11:01:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 04 Aug 2023 15:01:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 65051 X-GNU-PR-Package: emacs Original-Received: via spool by 65051-submit@debbugs.gnu.org id=B65051.16911612077176 (code B ref 65051); Fri, 04 Aug 2023 15:01:02 +0000 Original-Received: (at 65051) by debbugs.gnu.org; 4 Aug 2023 15:00:07 +0000 Original-Received: from localhost ([127.0.0.1]:54511 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qRwHe-0001rg-N7 for submit@debbugs.gnu.org; Fri, 04 Aug 2023 11:00:06 -0400 Original-Received: from mx3.muc.de ([193.149.48.5]:56802) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qRwHd-0001qb-6b for 65051@debbugs.gnu.org; Fri, 04 Aug 2023 11:00:06 -0400 Original-Received: (qmail 74014 invoked by uid 3782); 4 Aug 2023 16:59:59 +0200 Original-Received: from acm.muc.de (pd953a874.dip0.t-ipconnect.de [217.83.168.116]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Fri, 04 Aug 2023 16:59:59 +0200 Original-Received: (qmail 1465 invoked by uid 1000); 4 Aug 2023 14:59:58 -0000 Content-Disposition: inline In-Reply-To: <83leeqvpx8.fsf@gnu.org> X-Submission-Agent: TMDA/1.3.x (Ph3nix) X-Primary-Address: acm@muc.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:266685 Archived-At: Hello, Eli. On Fri, Aug 04, 2023 at 17:32:35 +0300, Eli Zaretskii wrote: > > Date: Fri, 4 Aug 2023 14:00:29 +0000 > > From: Alan Mackenzie > > Hello, Emacs. > > The code in question is in internal_equal (src/fns.c) ~37 lines from its > > start. We have: > > if (SYMBOL_WITH_POS_P (o1)) > > o1 = SYMBOL_WITH_POS_SYM (o1); > > if (SYMBOL_WITH_POS_P (o2)) > > o2 = SYMBOL_WITH_POS_SYM (o2); > > at the top level of the function. Thus > > (equal 'foo #) > > will return non-nil, regardless of the setting of > > symbols-with-pos-enabled. It should return non-nil only when that flag > > variable is non-nil. This is a bug. > > ######################################################################### > > A simple fix is: > What will happen to the comparison in internal_equal when > symbols_with_pos_enabled is zero and the two objects have different > positions, or one has a position, the other doesn't? In these cases, equal will return nil. This is correct. In the other case, when two symbols with position have the same base symbol and the same position, yet aren't identical, this will also return nil, which is incorrect. Do you think this case is worth bothering about? It could easily be amended. > And which branch are you proposing this change for? master. It doesn't seem important enough for the release branch. -- Alan Mackenzie (Nuremberg, Germany).