Branch: refs/heads/blead
  Home:   https://github.com/Perl/perl5
  Commit: b7d4839876122b66a95cb16b474368e80882a59c
      
https://github.com/Perl/perl5/commit/b7d4839876122b66a95cb16b474368e80882a59c
  Author: Richard Leach <[email protected]>
  Date:   2026-10-09 (Fri, 09 Oct 2026)

  Changed paths:
    M pod/perldelta.pod
    M regcomp_study.c
    M t/re/re_tests

  Log Message:
  -----------
  study_chunk: outer is_inf must not bleed into an inner CURLY

`Perl_study_chunk` has `is_inf` and `is_inf_internal`. Both signify the
presence of something, such as a `PLUS` (e.g. `x+`), that could
(theoretically) match infinitely long strings.

The difference is:
* `is_inf` - a something in _the pattern_ compiled thus far
* `is_inf_internal` - a something in _just this chunk_

If any chunk sets `is_inf_internal`, that propagates into `is_inf`.

While protecting against integer overflows,
9b139d09af7013f395939ac80e537edd55bb404a inadvertently used `is_inf`
rather than `is_inf_internal` in the `CURLY` studying code.

In GH #24915's example: `"xxbbbb" =~ /x+(?:b{2}){2}/`, the leading
`x+` correctly caused `is_inf` to be set, but the bug meant that
the `b{2}` was erroneously treated as if it could match infinitely.
That then resulted in the taking of a wrong branch, leading to
_intuit_ being erroneously instructed to start searching for the
`xbb` substring from position 2, rather than position 0.

This commit changes the `is_inf` in the `CURLY` branch into
`is_inf_internal`.


  Commit: 63514b55bbc42ef08d4b4c2f70f90cc02d829fc1
      
https://github.com/Perl/perl5/commit/63514b55bbc42ef08d4b4c2f70f90cc02d829fc1
  Author: Richard Leach <[email protected]>
  Date:   2026-10-09 (Fri, 09 Oct 2026)

  Changed paths:
    M regcomp_study.c

  Log Message:
  -----------
  regcomp_study: rename is_inf_internal to chunk_is_inf

As suggested in https://github.com/Perl/perl5/pull/24922.
This will hopefully make it a little clearer when to use `chunk_is_inf`
and not `is_inf`.


Compare: https://github.com/Perl/perl5/compare/d15b221202e3...63514b55bbc4

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

Reply via email to