summaryrefslogtreecommitdiff
path: root/lisp/progmodes/cperl-mode.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/progmodes/cperl-mode.el')
-rw-r--r--lisp/progmodes/cperl-mode.el3
1 files changed, 2 insertions, 1 deletions
diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el
index 2c258fb446a..58cbf26496d 100644
--- a/lisp/progmodes/cperl-mode.el
+++ b/lisp/progmodes/cperl-mode.el
@@ -3498,7 +3498,8 @@ Works before syntax recognition is done."
(if end
;; Do the same for end, going small steps
(save-excursion
- (while (and end (get-text-property end 'syntax-type))
+ (while (and end (< end (point-max))
+ (get-text-property end 'syntax-type))
(setq pos end
end (next-single-property-change end 'syntax-type nil (point-max)))
(if end (progn (goto-char end)