unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#53680: Endless loop in peculiar case of string-match and string-match-p 27.02 and 28.0.50
@ 2022-02-01  7:37 Christian Johansson
  2022-02-01 11:00 ` Lars Ingebrigtsen
  2022-02-01 12:56 ` Mattias Engdegård
  0 siblings, 2 replies; 9+ messages in thread
From: Christian Johansson @ 2022-02-01  7:37 UTC (permalink / raw)
  To: 53680

Hello

Some context first, since I needed a multi-line regexp matcher that 
could tell the difference of end-of-string vs newline ($ vs \n) in a 
string I replace occurrences of \n with \r in a string.

In a peculiar case a endless loop happens and I can reproduce this bug 
in Emacs 27.2 and 28.0.50 (have not tested any other versions), ok try 
to eval following snippet:

(string-match-p·"[\r\t·]*implements[\r\t·]+\\([\r\t·]*[\\a-zA-Z_0-9_]+,?\\)+[\r\t·]*{$"·"ariable·implements·\\Magento\\Framework\\Event\\OberserverInterface\r{\r····public·function·__construct()\r·") 


or

(string-match·"[\r\t·]*implements[\r\t·]+\\([\r\t·]*[\\a-zA-Z_0-9_]+,?\\)+[\r\t·]*{$"·"ariable·implements·\\Magento\\Framework\\Event\\OberserverInterface\r{\r····public·function·__construct()\r·")


-- 
Hälsningar / Best Regards
Christian






^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2022-02-01 16:23 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-01  7:37 bug#53680: Endless loop in peculiar case of string-match and string-match-p 27.02 and 28.0.50 Christian Johansson
2022-02-01 11:00 ` Lars Ingebrigtsen
2022-02-01 11:08   ` Lars Ingebrigtsen
2022-02-01 11:25     ` Andreas Schwab
2022-02-01 11:15   ` Andreas Schwab
2022-02-01 12:16     ` Lars Ingebrigtsen
2022-02-01 12:56 ` Mattias Engdegård
2022-02-01 13:12   ` Christian Johansson
     [not found]     ` <AB866492-4CC0-418A-8C9E-CAAB2C522CDA@acm.org>
2022-02-01 16:23       ` Christian Johansson

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).