#935420 emacs-common: in CPerl mode, Emacs hangs when editing a regexp with "(?"

Package:
emacs-common
Source:
emacs
Submitter:
Vincent Lefevre
Date:
2021-02-21 17:36:03 UTC
Severity:
normal
Tags:
#935420#5
Date:
2019-08-22 12:52:38 UTC
From:
To:
Open a file in cperl mode containing the following line:

  /(\d{4})(?: +){2}/;

e.g.: "emacs -Q file" then M-x cperl-mode <RET>

Put the cursor over the second opening brace, and type <DEL>
several times to delete what is before "{2}". When one types
<DEL> at this point:

  /(\d{4})(?:{2}/;
             ^cursor

Emacs freezes. One can type C-g to interrupt.

One can also reproduce the bug by typing: /(\d{4})(?{2
Emacs freezes before the "2" appears.

Note: This was the old Debian bug 734325. It is different from
bug 911573, which is fixed upstream (I could test), but this one
still occurs.