From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#34186: 26.1; locking up Date: Fri, 25 Jan 2019 16:30:07 +0000 Message-ID: <20190125163007.GA21111@ACM> References: <83munq6rmj.fsf@gnu.org> <83imye6ji6.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="9021"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mutt/1.10.1 (2018-07-13) Cc: 34186-done@debbugs.gnu.org To: Eli Zaretskii , Michael Menefee Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Jan 25 17:31:16 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gn4Nv-0002FE-D8 for geb-bug-gnu-emacs@m.gmane.org; Fri, 25 Jan 2019 17:31:15 +0100 Original-Received: from localhost ([127.0.0.1]:46976 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gn4Nu-00013i-EH for geb-bug-gnu-emacs@m.gmane.org; Fri, 25 Jan 2019 11:31:14 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:52280) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gn4Nm-00013J-S3 for bug-gnu-emacs@gnu.org; Fri, 25 Jan 2019 11:31:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gn4Nl-0006wF-Pp for bug-gnu-emacs@gnu.org; Fri, 25 Jan 2019 11:31:06 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:46169) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gn4Ni-0006uj-VY; Fri, 25 Jan 2019 11:31:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gn4Ni-0008Dn-Oi; Fri, 25 Jan 2019 11:31:02 -0500 Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-To: bug-gnu-emacs@gnu.org, bug-cc-mode@gnu.org Resent-Date: Fri, 25 Jan 2019 16:31:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 34186 X-GNU-PR-Package: emacs,cc-mode Mail-Followup-To: 34186@debbugs.gnu.org, acm@muc.de, mpmenefee@gmail.com Original-Received: via spool by 34186-done@debbugs.gnu.org id=D34186.154843384131569 (code D ref 34186); Fri, 25 Jan 2019 16:31:02 +0000 Original-Received: (at 34186-done) by debbugs.gnu.org; 25 Jan 2019 16:30:41 +0000 Original-Received: from localhost ([127.0.0.1]:45449 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gn4NM-0008D6-Nf for submit@debbugs.gnu.org; Fri, 25 Jan 2019 11:30:40 -0500 Original-Received: from colin.muc.de ([193.149.48.1]:19981 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1gn4NJ-0008Cs-Sl for 34186-done@debbugs.gnu.org; Fri, 25 Jan 2019 11:30:38 -0500 Original-Received: (qmail 39636 invoked by uid 3782); 25 Jan 2019 16:30:36 -0000 Original-Received: from acm.muc.de (p4FE15EE3.dip0.t-ipconnect.de [79.225.94.227]) by colin.muc.de (tmda-ofmipd) with ESMTP; Fri, 25 Jan 2019 17:30:35 +0100 Original-Received: (qmail 21156 invoked by uid 1000); 25 Jan 2019 16:30:07 -0000 Content-Disposition: inline In-Reply-To: <83imye6ji6.fsf@gnu.org> X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:154775 Archived-At: Hello, Eli and Michael. On Thu, Jan 24, 2019 at 19:41:21 +0200, Eli Zaretskii wrote: > > From: Michael Menefee > > Date: Thu, 24 Jan 2019 10:32:34 -0600 > > Cc: 34186@debbugs.gnu.org > > I have found the minimum necessary to consistently reproduce. copy/paste this into something.c to see if you > > get same results: > > void *AVL_first(AVL_t *); > > void *AVL_last(AVL_t *); > > #define (<--- locks up with pressing open parenthesis > Thanks, now I can reproduce this. Alan, please take a look. I've committed the following fix to the emacs-26 branch. I'm closing the bug. @Michael: This patch should apply cleanly to your Emacs 26.1 version (in directory .../emacs/lisp/progmodes). If you apply it, please byte-compile the file before using it. (If you want any help with the patching and/or byte-compiling, feel free to send me private email.) commit 9078f34e84178553cd59bc03ac1b58cb56038436 Author: Alan Mackenzie Date: Fri Jan 25 16:14:00 2019 +0000 Fix a loop in c-fl-decl-start. This fixes bug #34186. * lisp/progmodes/cc-mode.el (c-fl-decl-start) In the pair of operations c-syntactic-skip-backward and c-forward-syntactic-ws, ensure the latter doesn't come back to the position before the former, and break out of the enclosing loop if it does. diff --git a/lisp/progmodes/cc-mode.el b/lisp/progmodes/cc-mode.el index 8cbb4e8612..5283cfea6e 100644 --- a/lisp/progmodes/cc-mode.el +++ b/lisp/progmodes/cc-mode.el @@ -1487,6 +1487,7 @@ c-fl-decl-start ;; lock context (etc.) fontification. (goto-char pos) (let ((lit-start (c-literal-start)) + old-pos (new-pos pos) capture-opener bod-lim bo-decl) @@ -1509,12 +1510,14 @@ c-fl-decl-start (while ;; Go to a less nested declaration each time round this loop. (and + (setq old-pos (point)) (c-syntactic-skip-backward "^;{}" bod-lim t) (> (point) bod-lim) (progn (c-forward-syntactic-ws) ;; Have we got stuck in a comment at EOB? (not (and (eobp) (c-literal-start)))) + (< (point) old-pos) (progn (setq bo-decl (point)) (or (not (looking-at c-protection-key)) (c-forward-keyword-clause 1))) -- Alan Mackenzie (Nuremberg, Germany).