This fixes bug #18134.
* lisp/progmodes/cc-engine.el (c-crosses-statement-barrier-p): Give a limit
to the c-backward-syntactic-ws which is searching for a virtual semicolon. In
the main loop, Use c-forward-syntactic-ws to skip blocks of comments.
(progn
(if (setq lit-start (c-literal-start from)) ; Have we landed in a string/comment?
(goto-char lit-start))
- (c-backward-syntactic-ws) ; ? put a limit here, maybe?
+ (c-backward-syntactic-ws (c-point 'bopl))
(setq vsemi-pos (point))
(c-at-vsemi-p))))
(throw 'done vsemi-pos))
+ ;; Optimize for large blocks of comments.
+ ((progn (c-forward-syntactic-ws to)
+ (>= (point) to))
+ (throw 'done nil))
;; In a string/comment?
((setq lit-range (c-literal-limits from))
(goto-char (cdr lit-range)))