; cperl-mode.el: prevent Emacs from "freezing" (Bug#70948)
* cperl-mode.el (defconst): Replace the rx expression for `cperl--basic-identifier-rx' with its actual macro expansion. This makes it efficient under Emacs 29.3, where the expansion by rx.el could make Emacs freeze with a crafted Perl source (Bug#70948).
This commit is contained in:
parent
96269209a3
commit
54a7268763
1 changed files with 6 additions and 1 deletions
|
@ -1178,7 +1178,12 @@ The expansion is entirely correct because it uses the C preprocessor."
|
|||
(eval-and-compile
|
||||
|
||||
(defconst cperl--basic-identifier-rx
|
||||
'(sequence (or alpha "_") (* (or word "_")))
|
||||
;; The rx expression in the following line is a workaround for
|
||||
;; bug#70948 under Emacs 29
|
||||
'(regex "[_[:alpha:]][_[:word:]]*")
|
||||
;; The rx expression in the following line is equivalent but
|
||||
;; inefficient under Emacs 29.3
|
||||
;; '(sequence (or alpha "_") (* (or word "_")))
|
||||
"A regular expression for the name of a \"basic\" Perl variable.
|
||||
Neither namespace separators nor sigils are included. As is,
|
||||
this regular expression applies to labels,subroutine calls where
|
||||
|
|
Loading…
Add table
Reference in a new issue