mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-15 18:40:39 -08:00
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.
This commit is contained in:
parent
a177fe754d
commit
9078f34e84
1 changed files with 3 additions and 0 deletions
|
|
@ -1487,6 +1487,7 @@ Note that this is a strict tail, so won't match, e.g. \"0x....\".")
|
||||||
;; lock context (etc.) fontification.
|
;; lock context (etc.) fontification.
|
||||||
(goto-char pos)
|
(goto-char pos)
|
||||||
(let ((lit-start (c-literal-start))
|
(let ((lit-start (c-literal-start))
|
||||||
|
old-pos
|
||||||
(new-pos pos)
|
(new-pos pos)
|
||||||
capture-opener
|
capture-opener
|
||||||
bod-lim bo-decl)
|
bod-lim bo-decl)
|
||||||
|
|
@ -1509,12 +1510,14 @@ Note that this is a strict tail, so won't match, e.g. \"0x....\".")
|
||||||
(while
|
(while
|
||||||
;; Go to a less nested declaration each time round this loop.
|
;; Go to a less nested declaration each time round this loop.
|
||||||
(and
|
(and
|
||||||
|
(setq old-pos (point))
|
||||||
(c-syntactic-skip-backward "^;{}" bod-lim t)
|
(c-syntactic-skip-backward "^;{}" bod-lim t)
|
||||||
(> (point) bod-lim)
|
(> (point) bod-lim)
|
||||||
(progn (c-forward-syntactic-ws)
|
(progn (c-forward-syntactic-ws)
|
||||||
;; Have we got stuck in a comment at EOB?
|
;; Have we got stuck in a comment at EOB?
|
||||||
(not (and (eobp)
|
(not (and (eobp)
|
||||||
(c-literal-start))))
|
(c-literal-start))))
|
||||||
|
(< (point) old-pos)
|
||||||
(progn (setq bo-decl (point))
|
(progn (setq bo-decl (point))
|
||||||
(or (not (looking-at c-protection-key))
|
(or (not (looking-at c-protection-key))
|
||||||
(c-forward-keyword-clause 1)))
|
(c-forward-keyword-clause 1)))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue