Branch: refs/heads/yves/fix_22892 Home: https://github.com/Perl/perl5 Commit: 7e64928e3db4577d30fa451dfa126fe7897d2fd9 https://github.com/Perl/perl5/commit/7e64928e3db4577d30fa451dfa126fe7897d2fd9 Author: Yves Orton <demer...@gmail.com> Date: 2025-02-07 (Fri, 07 Feb 2025)
Changed paths: M regexec.c M t/re/re_tests Log Message: ----------- regexec.c - Fix GH 22892 - AHO-CORASICK doesn't handle certain edge cases properly In some circumstances the AHO-CORASICK logic wasn't matching properly when there were two possibilities whose proper prefix matches a proper suffix of a third possibilty, and one of those possibilities was shorter than the other. This was because we were resetting the failed flag properly. This bug must be rare because it took more than a decade for anyone to notice. This patch fixes the problem by resetting the failed flag after a successful transition. A good example of this problem is as follows: "ABCDE" =~ m/ABCF|BCDE|C/ This should match 'BCDE' and not 'C'. Because of the flag issue we were matching 'C' instead. To unsubscribe from these emails, change your notification settings at https://github.com/Perl/perl5/settings/notifications