Commit 081fb694 authored by Alan Mackenzie's avatar Alan Mackenzie

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.
parent f4ea7464
Pipeline #339 failed with stage
in 2 seconds
......@@ -1284,8 +1284,8 @@ casts and declarations are fontified. Used on level 2 and higher."
(goto-char match-pos)
(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.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment