Branch: refs/heads/yves/hydahy_gh18032
  Home:   https://github.com/Perl/perl5
  Commit: ced66c57ba8dba38ed842e4e9b07308283569de6
      
https://github.com/Perl/perl5/commit/ced66c57ba8dba38ed842e4e9b07308283569de6
  Author: Richard Leach <richardle...@users.noreply.github.com>
  Date:   2024-03-09 (Sat, 09 Mar 2024)

  Changed paths:
    M ext/re/re.pm
    M pod/perlfunc.pod
    M pod/perlre.pod
    M regcomp.c
    M t/op/split.t

  Log Message:
  -----------
  regcomp.c - Exclude split STRING from /x default modifiers.

We have a magic special case with split STRING where if the STRING
is a single space character we trigger awk emaulation mode, which
causes split to ignore leading whitespace, and to split on \s+.

When default regex modifier support was added to perl we didn't notice
that it doesn't make sense for the /x modifiers to change the behavior
of a STRING pattern in split. STRING patterns are NOT parsed using the
normal pattern parsing rules, for instance "\s+" would split on 's'
characters, not on whitepace. The /x modifier is designed to change the
rules for *pattern* parsing, most notably by adding support for comments
and ignoring whitespace in pattern definitions. This feels to me like a
feature that should only apply to cases where a true pattern is parsed,
such as where \s+ would be treated as the special pattern for matching
whitespace and not a literal 's' character. Historically there was NO way
to create a string pattern with the /x pattern enabled, to enable /x the
string MUST have been fed into a true pattern parsing construct like
qr// m// or s///.

By excluding STRING patterns from /x notation, we ensure that the
special case of awk emulation for C<split " "> is preserved.

Note that a default /x modifier *does* change the behavior of
C<split / />, as the pattern in that case is parsed the same as
C<split qr/ /> or C<m/ />.

With changes by Yves Orton

Fixes #18032


  Commit: e4ec892374f627ddc9b98e8e74ab489fb5e9f676
      
https://github.com/Perl/perl5/commit/e4ec892374f627ddc9b98e8e74ab489fb5e9f676
  Author: Yves Orton <demer...@gmail.com>
  Date:   2024-03-09 (Sat, 09 Mar 2024)

  Changed paths:
    M regcomp.c

  Log Message:
  -----------
  regcomp.c - move comment to match code

A sub was injected into the code in between the comment and
the sub the comment was about. Move the comment to line up with
the sub.


  Commit: caf069d361a29637fac2e18cdbfd0e619a38e2ae
      
https://github.com/Perl/perl5/commit/caf069d361a29637fac2e18cdbfd0e619a38e2ae
  Author: Yves Orton <demer...@gmail.com>
  Date:   2024-03-09 (Sat, 09 Mar 2024)

  Changed paths:
    M embed.fnc
    M embed.h
    M proto.h
    M regcomp.c
    M regcomp_study.c

  Log Message:
  -----------
  regcomp.c - move some functions back from regcomp_study.c

In an earlier commit I moved various study related functions out of
regcomp.c into regcomp_study.c. Arguably these two functions should not
have been moved, as they are only called from regcomp.c and thus can be
marked as static when they live in that file, which in turn avoids
problems with the re extension where we compile the code a second time
with debugging enabled.


  Commit: 8eaf57da409aac419b992d7e5befe250d7e9fbc6
      
https://github.com/Perl/perl5/commit/8eaf57da409aac419b992d7e5befe250d7e9fbc6
  Author: Yves Orton <demer...@gmail.com>
  Date:   2024-03-09 (Sat, 09 Mar 2024)

  Changed paths:
    M regcomp.c

  Log Message:
  -----------
  regcomp.c - zero the pRExC_state structure early in compilation

And initialize various members, especially RExC_mysv1 and RExC_mysv2
as early as possible under debugging.

Under -Uusedl we were ending up with the mysv1 and mysv2 slots set to
random pointers as the structure wasnt zeroed properly, and the
initialization for the temporary sv's wasn't performed correctly, which
then lead to segfaults.

Arguably we should have been using Zero() from the very beginning, as
we have had multiple bugs over the years where we added a member to
the structure but forgot to zero it at the start of compilation. This
change rectifies that and will prevent future oversights.


  Commit: fb9291c6339c664b1c6264293bd8bae1cada9eec
      
https://github.com/Perl/perl5/commit/fb9291c6339c664b1c6264293bd8bae1cada9eec
  Author: Yves Orton <demer...@gmail.com>
  Date:   2024-03-09 (Sat, 09 Mar 2024)

  Changed paths:
    M ext/re/re.pm
    M ext/re/re_top.h

  Log Message:
  -----------
  ext/re/re_top.h - override some function names when compiling the extension

Otherwise under -Uusedl tests in t/op/split.t may fail or will produce
debugging output when they should not. Argubly this a work-around fix
and we should do something more thorough to ensure that the debgging
regex engine can be built properly under -Uusedl (static extensions)
but for now I think this is good enough.


Compare: https://github.com/Perl/perl5/compare/12d9d972e1e6...fb9291c6339c

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

Reply via email to