1 new commit in cc-mode:
https://bitbucket.org/xemacs/cc-mode/commits/92de7b41bfc9/
Changeset: 92de7b41bfc9
User: acm
Date: 2017-10-25 17:59:54+00:00
Summary: Fix a "wrong side of point" error in CC Mode. Fixes bug #28850.
The cause was a scanning over a bracket pair taking us beyond the supplied
LIMIT parameter in c-forward-declarator.
* cc-engine.el (c-forward-declarator): Add three checks (< (point) limit)
whilst dealing with tokens after the declared identifier.
* cc-fonts.el (c-font-lock-declarators): Don't supply a LIMIT argument to
`c-forward-declarator' (twice), since we want to fontify up till the end of a
declarator, not an arbitrary jit-lock chunk end.
Affected #: 2 files
diff -r e8b41be48ec5204df18d51eca0924527e82d8ee1 -r
92de7b41bfc97db49178d2f7317ce6583584ed94 cc-engine.el
--- a/cc-engine.el
+++ b/cc-engine.el
@@ -8123,12 +8123,14 @@
;; initializing brace lists.
(let (found)
(while
- (and (progn
+ (and (< (point) limit)
+ (progn
;; In the next loop, we keep searching forward whilst
;; we find ":"s which aren't single colons inside C++
;; "for" statements.
(while
(and
+ (< (point) limit)
(setq found
(c-syntactic-re-search-forward
"[;:,]\\|\\s)\\|\\(=\\|\\s(\\)"
@@ -8150,7 +8152,7 @@
(c-go-up-list-forward))
(setq brackets-after-id t))
(when found (backward-char))
- t))
+ (<= (point) limit)))
(list id-start id-end brackets-after-id (match-beginning 1) decorated)
(goto-char here)
diff -r e8b41be48ec5204df18d51eca0924527e82d8ee1 -r
92de7b41bfc97db49178d2f7317ce6583584ed94 cc-fonts.el
--- a/cc-fonts.el
+++ b/cc-fonts.el
@@ -1062,7 +1062,7 @@
;; The following `while' fontifies a single declarator id each time round.
;; It loops only when LIST is non-nil.
(while
- (and pos (setq decl-res (c-forward-declarator limit)))
+ (and pos (setq decl-res (c-forward-declarator)))
(setq next-pos (point)
id-start (car decl-res)
id-face (if (and (eq (char-after) ?\()
@@ -1091,7 +1091,7 @@
(throw 'is-function nil))
((not (eq got-type 'maybe))
(throw 'is-function t)))
- (c-forward-declarator limit t)
+ (c-forward-declarator nil t)
(eq (char-after) ?,))
(forward-char)
(c-forward-syntactic-ws))
Repository URL:
https://bitbucket.org/xemacs/cc-mode/
--
This is a commit notification from
bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.