From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#43499: 27.1; It is possible for (forward-comment -1) to crash emacs Date: Sat, 19 Sep 2020 19:56:47 +0300 Message-ID: <835z893dtc.fsf@gnu.org> References: Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13610"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 43499@debbugs.gnu.org To: Jeff Norden Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Sep 19 18:58:10 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 1kJgBe-0003NC-CP for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 19 Sep 2020 18:58:10 +0200 Original-Received: from localhost ([::1]:52700 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kJgBd-0000SY-Et for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 19 Sep 2020 12:58:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34316) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kJgBW-0000SO-Cn for bug-gnu-emacs@gnu.org; Sat, 19 Sep 2020 12:58:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:36417) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kJgBW-0006Fs-3P for bug-gnu-emacs@gnu.org; Sat, 19 Sep 2020 12:58:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kJgBW-00038D-1m for bug-gnu-emacs@gnu.org; Sat, 19 Sep 2020 12:58:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 19 Sep 2020 16:58:01 +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.160053462811972 (code B ref 43499); Sat, 19 Sep 2020 16:58:01 +0000 Original-Received: (at 43499) by debbugs.gnu.org; 19 Sep 2020 16:57:08 +0000 Original-Received: from localhost ([127.0.0.1]:47963 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kJgAe-000372-F2 for submit@debbugs.gnu.org; Sat, 19 Sep 2020 12:57:08 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:55362) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kJgAa-00036Z-SA for 43499@debbugs.gnu.org; Sat, 19 Sep 2020 12:57:07 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:48108) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kJgAV-00065f-3S; Sat, 19 Sep 2020 12:56:59 -0400 Original-Received: from [176.228.60.248] (port=3568 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kJgAL-0008Nw-S6; Sat, 19 Sep 2020 12:56:53 -0400 In-Reply-To: (message from Jeff Norden on Sat, 19 Sep 2020 11:24:23 -0500) 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:188414 Archived-At: > From: Jeff Norden > Cc: 43499@debbugs.gnu.org > Date: Sat, 19 Sep 2020 11:24:23 -0500 > > > 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. Thanks, I installed my changes. > 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. It was clear to me, FWIW.