From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Kangas Newsgroups: gmane.emacs.bugs Subject: bug#43499: 27.1; It is possible for (forward-comment -1) to crash emacs Date: Thu, 12 Nov 2020 22:40:17 -0500 Message-ID: References: <835z893dtc.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="9851"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 43499@debbugs.gnu.org, Jeff Norden To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Nov 13 04:41:12 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 1kdPxW-0002Nl-Eq for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 13 Nov 2020 04:41:10 +0100 Original-Received: from localhost ([::1]:57074 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kdPxU-00018w-TG for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 12 Nov 2020 22:41:08 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41860) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kdPxO-00018j-1E for bug-gnu-emacs@gnu.org; Thu, 12 Nov 2020 22:41:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:34763) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kdPxN-00059m-OA for bug-gnu-emacs@gnu.org; Thu, 12 Nov 2020 22:41:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kdPxN-0002o9-Kf for bug-gnu-emacs@gnu.org; Thu, 12 Nov 2020 22:41:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Kangas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 13 Nov 2020 03:41: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.160523882710746 (code B ref 43499); Fri, 13 Nov 2020 03:41:01 +0000 Original-Received: (at 43499) by debbugs.gnu.org; 13 Nov 2020 03:40:27 +0000 Original-Received: from localhost ([127.0.0.1]:46309 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kdPwp-0002nG-1B for submit@debbugs.gnu.org; Thu, 12 Nov 2020 22:40:27 -0500 Original-Received: from mail-ej1-f44.google.com ([209.85.218.44]:36775) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kdPwm-0002n1-LW for 43499@debbugs.gnu.org; Thu, 12 Nov 2020 22:40:25 -0500 Original-Received: by mail-ej1-f44.google.com with SMTP id o21so11294605ejb.3 for <43499@debbugs.gnu.org>; Thu, 12 Nov 2020 19:40:24 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:in-reply-to:references:user-agent :mime-version:date:message-id:subject:to:cc; bh=x9KX5a4Dofj8zAyRHrJJx8+FitHFtd93zvsbWVdEnOA=; b=eaogD/IYLQ3dMYRT0dpOge8TNdmDxH6bAGz718KhuFvERguBqZBVTo1UwEDWsXhe1u DdW3eyomW5NPf7arehXknDXTPmDxOWG64hiuP8g3r9IzJB8WCNKZw5jvPMbpDgJZjvlG QA5gmbNvWOTw6swa2t/5d/zELAgN/WEE8FwUbA0yoIqRX/0F5H41TGBozXkb0SwYMRql LGGELNlst6GD97NsyJ8aIl52vYSF5BhNFsTKa5CBAeIZY/4J9FzYgHtpRXJnoUhf0qQG FAC+v+UHefl7lFvFYfDcr56g2O2kH459djCQRnzNQUZh18VXUEIGbsftuVhTyABKAK1m G/pg== X-Gm-Message-State: AOAM532dfAoyYSAhrqy511Mv2UKlt5oyntq3DdluwHKi3KBoItkTv1xe X4jfa70fMIlhAUSOSqzBQusYzNq0+UmxC1jtcdIzJ5tN X-Google-Smtp-Source: ABdhPJxNR7LahCKcx14qFslfe3ym7yBtzyhvvrXdR7pUQrgTuqnSAzf/iDlJR+GqZ6rB40RViBdyAxUSO6VrB96VIEY= X-Received: by 2002:a17:906:804:: with SMTP id e4mr120729ejd.420.1605238819021; Thu, 12 Nov 2020 19:40:19 -0800 (PST) Original-Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Thu, 12 Nov 2020 22:40:17 -0500 In-Reply-To: <835z893dtc.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 19 Sep 2020 19:56:47 +0300") 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:193202 Archived-At: Eli Zaretskii writes: >> 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. Did that fix the issue? Does that mean that this bug can be closed?