From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jeff Norden Newsgroups: gmane.emacs.bugs Subject: bug#43499: 27.1; It is possible for (forward-comment -1) to crash emacs Date: Sat, 19 Sep 2020 11:24:23 -0500 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1392"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 43499@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Sep 19 18:55:27 2020 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 1kJg91-0000DK-8f for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 19 Sep 2020 18:55:27 +0200 Original-Received: from localhost ([::1]:49418 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kJg90-0007Le-9o for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 19 Sep 2020 12:55:26 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55886) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kJffb-00031d-7F for bug-gnu-emacs@gnu.org; Sat, 19 Sep 2020 12:25:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:36352) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kJffa-0001e3-Rh for bug-gnu-emacs@gnu.org; Sat, 19 Sep 2020 12:25:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kJffa-0006QD-NJ for bug-gnu-emacs@gnu.org; Sat, 19 Sep 2020 12:25:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Jeff Norden Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 19 Sep 2020 16:25:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 43499 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 43499-submit@debbugs.gnu.org id=B43499.160053267124597 (code B ref 43499); Sat, 19 Sep 2020 16:25:02 +0000 Original-Received: (at 43499) by debbugs.gnu.org; 19 Sep 2020 16:24:31 +0000 Original-Received: from localhost ([127.0.0.1]:47889 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kJff4-0006Of-VS for submit@debbugs.gnu.org; Sat, 19 Sep 2020 12:24:31 -0400 Original-Received: from mta.tntech.edu ([149.149.2.87]:28931) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kJff1-0006OU-2A for 43499@debbugs.gnu.org; Sat, 19 Sep 2020 12:24:29 -0400 Original-Received: from math.tntech.edu (unknown [149.149.102.6]) by mta.tntech.edu (Postfix) with ESMTPS id 9A3013000054; Sat, 19 Sep 2020 11:24:25 -0500 (CDT) Original-Received: from norden.tntech.edu ([149.149.102.4] helo=norden.math.tntech.edu) by math.tntech.edu with esmtp (Exim 4.92) (envelope-from ) id 1kJfex-0003C5-6c; Sat, 19 Sep 2020 11:24:23 -0500 Original-Received: by norden.math.tntech.edu (Postfix, from userid 742) id 27F242572B73; Sat, 19 Sep 2020 11:24:23 -0500 (CDT) In-Reply-To: <83pn6i2kws.fsf@gnu.org> (message from Eli Zaretskii on Sat, 19 Sep 2020 12:08:51 +0300) X-SA-Spam-Score: 0.0 X-SA-Spam-Report: Spam detection software, running on the system "math.tntech.edu", has NOT identified this incoming email as spam. If you have any questions, contact @@CONTACT_ADDRESS@@ pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 T_SPF_HELO_TEMPERROR SPF: test of HELO record failed (temperror) 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" Xref: news.gmane.io gmane.emacs.bugs:188409 Archived-At: > Thanks. I propose a slightly different change below. I think it's > somewhat better, because it does the comparison only once, and the > while loop can then run at full speed without testing on each > iteration. (It looks like a large change, but almost all of it is > just whitespace changes due to re-indentation of the loop.) Do you > agree? I think either change will work fine. It doesn't seem to me that either one would be faster, unless I'm missing something. My suggestion was to move the test from the body of the loop (where from == stop is checked each iteration) to the clause of the while statement (as from > stop instead). But, maybe a test before the loop starts makes the code more clear - that is entirely your call. Perhaps I should have included my patch in the body of the email, instead of as an attachment, which might have made my suggestion more clear. Also, it's good that you and Alan are getting segfaults instead of the really horrible behavior that I found. Maybe some change since 27.1 has helped with that. Regards, -Jeff