Branch: refs/heads/yves/fix_22892
  Home:   https://github.com/Perl/perl5
  Commit: b52d11968d19610526a6d8f7e214f5dbebdd86b4
      
https://github.com/Perl/perl5/commit/b52d11968d19610526a6d8f7e214f5dbebdd86b4
  Author: Yves Orton <[email protected]>
  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.

This fixes https://github.com/Perl/perl5/issues/22892



To unsubscribe from these emails, change your notification settings at 
https://github.com/Perl/perl5/settings/notifications

Reply via email to