emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] emacs-26 081fb69: Check result from c-backward-token-2 to


From: Alan Mackenzie
Subject: [Emacs-diffs] emacs-26 081fb69: Check result from c-backward-token-2 to avoid infinite loop
Date: Thu, 20 Dec 2018 07:30:44 -0500 (EST)

branch: emacs-26
commit 081fb694c3f88e77d4a0e09fba8ce457037b9132
Author: Alan Mackenzie <address@hidden>
Commit: Alan Mackenzie <address@hidden>

    Check result from c-backward-token-2 to avoid infinite loop
    
    This fixes bug #33784.
    
    * lisp/progmodes/cc-fonts.el (c-get-fontification-context): While moving 
back
    over enclosing parentheses, check that c-backward-token-2 actually moves.
---
 lisp/progmodes/cc-fonts.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lisp/progmodes/cc-fonts.el b/lisp/progmodes/cc-fonts.el
index 39d167f..2e47bda 100644
--- a/lisp/progmodes/cc-fonts.el
+++ b/lisp/progmodes/cc-fonts.el
@@ -1284,8 +1284,8 @@ casts and declarations are fontified.  Used on level 2 
and higher."
                (save-excursion
                  (goto-char match-pos)
                  (while
-                     (progn (c-backward-token-2)
-                            (eq (char-after) ?\()))
+                     (and (zerop (c-backward-token-2))
+                          (eq (char-after) ?\()))
                  (looking-at c-arithmetic-op-regexp)))
           (cons nil nil))
          ;; In a C++ member initialization list.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]