]> git.eshelyaron.com Git - emacs.git/commitdiff
progmodes/cc-fonts.el (c-font-lock-declarators): Fix infinite loop, bug
authorAlan Mackenzie <acm@muc.de>
Sat, 23 Aug 2014 11:02:20 +0000 (11:02 +0000)
committerAlan Mackenzie <acm@muc.de>
Sat, 23 Aug 2014 11:02:20 +0000 (11:02 +0000)
#18306.  The bug was introduced on 2014-08-02.

lisp/ChangeLog
lisp/progmodes/cc-fonts.el

index 0620164c6dd063308757717c9c528fdca1fdfc0c..920eea268f4afb827a0e9fb81a53d7041a134ead 100644 (file)
@@ -1,3 +1,8 @@
+2014-08-23  Alan Mackenzie  <acm@muc.de>
+
+       * progmodes/cc-fonts.el (c-font-lock-declarators): Fix infinite
+       loop, bug #18306.  The bug was introduced on 2014-08-02.
+
 2014-08-21  Eli Zaretskii  <eliz@gnu.org>
 
        * textmodes/texnfo-upd.el (texinfo-specific-section-type): Don't
index a107ef0125029a228851b1e230b34fcda928f102..ceb86b45fb1fefd04118c82487bf752134c69c79 100644 (file)
@@ -1116,14 +1116,11 @@ casts and declarations are fontified.  Used on level 2 and higher."
            ;; initializing brace lists.
            (let (found)
              (while
-                 (and (setq found
-                            (c-syntactic-re-search-forward
-                             "[;,]\\|\\s)\\|\\'\\|\\(=\\|\\s(\\)" limit t t))
-                      (eq (char-before) ?\[))
-               (backward-char)
-               (c-safe (c-forward-sexp 1))
-               (setq found nil)
-               (setq brackets-after-id t))
+                 (and (setq found (c-syntactic-re-search-forward
+                            "[;,]\\|\\s)\\|\\'\\|\\(=\\|\\s(\\)" limit t t))
+                      (eq (char-before) ?\[)
+                      (c-go-up-list-forward))
+                    (setq brackets-after-id t))
              found))
 
       (setq next-pos (match-beginning 0)