diff options
author | Alan Mackenzie <acm@muc.de> | 2018-12-20 12:21:16 +0000 |
---|---|---|
committer | Alan Mackenzie <acm@muc.de> | 2018-12-20 12:21:16 +0000 |
commit | 081fb694c3f88e77d4a0e09fba8ce457037b9132 (patch) | |
tree | b2f42c6a28eeadfd95733fcf4b3fad52875a4083 /lisp/progmodes/cc-fonts.el | |
parent | f4ea7464516b22409f429e98595b97cbf8220f4c (diff) | |
download | emacs-081fb694c3f88e77d4a0e09fba8ce457037b9132.tar.gz |
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.
Diffstat (limited to 'lisp/progmodes/cc-fonts.el')
-rw-r--r-- | lisp/progmodes/cc-fonts.el | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lisp/progmodes/cc-fonts.el b/lisp/progmodes/cc-fonts.el index 39d167f0190..2e47bdab567 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. |