Subject: bug#65726: 29.1.50; Crash in regexp engine

From: Eli Zaretskii <[email-masked]>
Date: Mon, 04 Sep 2023 18:57:41 +0300

> Cc: [email-masked]
> Date: Mon, 04 Sep 2023 10:32:38 -0400
> From:  Stefan Monnier via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <[email-masked]>
> 
> Re-reading the code I see that `skip_noops` can return a position
> smaller than its argument, which makes it possible for `p2` to
> be smaller (or equal) to `p2_orig` and hence explain that inf-loop
> (that's the only path I can see that explains the inf-loop you're
> seeing).
> 
> So, the patch below should hopefully fix your problem.

Yes, with this patch the problem is gone.

Please install on the release branch, when you are satisfied with the
solution, and thanks.