From f3d01d465398afee11c584a559c6842f575f5a03 Mon Sep 17 00:00:00 2001
From: Eli Zaretskii <eliz@gnu.org>
Date: Thu, 25 Oct 2018 17:57:34 +0300
Subject: Avoid infloop in CPerl mode fontification

* lisp/progmodes/cperl-mode.el
(cperl-font-lock-fontify-region-function): Stop the loop at
EOB, to avoid inflooping there.  (Bug#33114)
---
 lisp/progmodes/cperl-mode.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'lisp/progmodes/cperl-mode.el')

diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el
index 6dbdba75de6..b152b9c724d 100644
--- a/lisp/progmodes/cperl-mode.el
+++ b/lisp/progmodes/cperl-mode.el
@@ -8884,7 +8884,7 @@ do extra unwind via `cperl-unwind-to-safe'."
 	(goto-char new-beg)))
     (setq beg (point))
     (goto-char end)
-    (while (and end
+    (while (and end (< end (point-max))
 		(progn
 		  (or (bolp) (condition-case nil
 				 (forward-line 1)
-- 
cgit v1.2.3