]> git.eshelyaron.com Git - emacs.git/commitdiff
Avoid infloop in CPerl mode fontification
authorEli Zaretskii <eliz@gnu.org>
Thu, 25 Oct 2018 14:57:34 +0000 (17:57 +0300)
committerEli Zaretskii <eliz@gnu.org>
Thu, 25 Oct 2018 14:57:34 +0000 (17:57 +0300)
* 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

index 6dbdba75de60e86af6d1eb2098df7da62e723a1f..b152b9c724d234be0a0ae2a6094474f07e604777 100644 (file)
@@ -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)