This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perl5.git
2 years agoreg_mesg.t: Wasn't testing what it purported to be
Karl Williamson [Sun, 6 Mar 2022 18:42:48 +0000 (11:42 -0700)]
reg_mesg.t: Wasn't testing what it purported to be

The experimental regex sets warnings messages being output were getting
in the way, and causing tests to pass for the wrong reasons.

2 years agoPorting/epigraphs - Add epigraph for 5.34.1-RC2
Steve Hay [Sun, 6 Mar 2022 17:33:08 +0000 (17:33 +0000)]
Porting/epigraphs - Add epigraph for 5.34.1-RC2

2 years ago5.34.1-RC2 today
Steve Hay [Sun, 6 Mar 2022 16:15:03 +0000 (16:15 +0000)]
5.34.1-RC2 today

2 years agoFix utf8_to_uvchr for non-core calls
Karl Williamson [Fri, 4 Mar 2022 21:25:21 +0000 (14:25 -0700)]
Fix utf8_to_uvchr for non-core calls

Commit a460925186154b270b7a647a4f30b2f01fd97c4b broke calling this and
related functions from outside of core Perl, but only when the input is
empty (which is an error anyway, so was not caught except for deliberate
API edge case tests in Devel::PPPort).

2 years agoperlrun.pod and INSTALL: document PERL_PERTURB_KEYS better
Yves Orton [Sat, 5 Mar 2022 07:31:51 +0000 (08:31 +0100)]
perlrun.pod and INSTALL: document PERL_PERTURB_KEYS better

Expand on the documentation of PERL_PERTURB_KEYS and PERL_HASH_SEED.
Specifically note that any change in the environment may change the
key order under PERL_PERTURB_KEYS=DETERMINISTIC.

2 years agoProperly handle UTF8-flagged strings when assigning to $0.
Felipe Gasper [Fri, 7 Jan 2022 19:28:39 +0000 (14:28 -0500)]
Properly handle UTF8-flagged strings when assigning to $0.

Issue #19331: Use of SvPV_const and SvPV_force in S_set_dollarzero()
wrote the PV internals directly to argv, which causes an improper UTF-8
encode if the SV is UTF8-flagged/upgraded.

This fixes that doing a downgrade prior to those SvPV* calls. If the
string contains wide characters (and thus cannot be downgraded) a
warning is thrown; this mirrors preexisting behavior with %ENV, print,
and other output channels that convert Perl SVs to bytes.

The relevant documentation is also updated.

2 years agoutf8_to_uvchr_buf_helper: Check before deref
Karl Williamson [Sun, 6 Mar 2022 01:03:23 +0000 (18:03 -0700)]
utf8_to_uvchr_buf_helper: Check before deref

*s may not be valid here; check first.

2 years agoFixed possible syntax error in Configure's test program for Inf/NaN bytes.
TAKAI Kousuke [Tue, 5 Oct 2021 14:17:33 +0000 (23:17 +0900)]
Fixed possible syntax error in Configure's test program for Inf/NaN bytes.

"try.c" for (double|longdbl)(inf|nan)bytes seems to lack some
preprocessor directives (probably accidentaly removed) and
caused syntax error if HAS_LONG_DOUBLE is not defined.

2 years agoutf8.c: Klortho advises: Check before deref
Karl Williamson [Sat, 5 Mar 2022 16:43:48 +0000 (09:43 -0700)]
utf8.c: Klortho advises: Check before deref

Don't deref before checking that it is ok to

2 years agoExtUtils-ParseXS: bump version to 3.45
Brad Barden [Fri, 4 Mar 2022 22:45:10 +0000 (22:45 +0000)]
ExtUtils-ParseXS: bump version to 3.45

2 years agoExtUtils-ParseXS: fix 002-more.t plan
Brad Barden [Fri, 4 Mar 2022 22:44:04 +0000 (22:44 +0000)]
ExtUtils-ParseXS: fix 002-more.t plan

forgot to increment the plan number

2 years agoExtUtils::ParseXS: add OVERLOAD regression tests
Brad Barden [Mon, 3 Jan 2022 17:58:06 +0000 (17:58 +0000)]
ExtUtils::ParseXS: add OVERLOAD regression tests

2 years agoExtUtils::ParseXS: fix OVERLOAD/FALLBACK handling
Brad Barden [Sun, 2 Jan 2022 05:49:51 +0000 (05:49 +0000)]
ExtUtils::ParseXS: fix OVERLOAD/FALLBACK handling

move code generation for xsubs with overloads out of OVERLOAD_HANLDER. they
must come after ->{newXS} et al have been populated. previously, the values of
the preceding xsub (empty if one happened to use OVERLOAD on the first xsub in
the file) were used.

change handling of overloads and fallback from global-per-XS-file to
per-package. previously, if multiple packages existed in a single XS file with
any OVERLOAD, the _nil function and () sub for fetchmethod was created only for
the last package in the file (even if that one didn't have overloads). xsubs in
any packages other than the very last one would not be able to have OVERLOAD
function correctly.

there should be no change in behavior for existing code.

2 years agoAdd test for the previous commit fixing Perl_my_strtod
TAKAI Kousuke [Fri, 4 Mar 2022 14:32:27 +0000 (23:32 +0900)]
Add test for the previous commit fixing Perl_my_strtod

Perl core itself seems not to call my_strtod, so test it with XS::APItest.

2 years agonumeric.c: Fix possible null pointer dereferences
TAKAI Kousuke [Thu, 3 Mar 2022 14:09:05 +0000 (23:09 +0900)]
numeric.c: Fix possible null pointer dereferences

Previous code apparently dereferences a variable initialized to NULL.

2 years agoAdd new email for Brad Barden
Karl Williamson [Sat, 5 Mar 2022 16:59:28 +0000 (09:59 -0700)]
Add new email for Brad Barden

2 years agoutf8.c: Fix typo in comment
Karl Williamson [Sat, 5 Mar 2022 16:38:38 +0000 (09:38 -0700)]
utf8.c: Fix typo in comment

2 years agoperl.c: Remove run time docs and redundant support for -DH
Yves Orton [Sat, 5 Mar 2022 13:54:10 +0000 (14:54 +0100)]
perl.c: Remove run time docs and redundant support for -DH

In 2017 in fcd573e77ec68fbe3936ac1381654581fba8a64f Dave Mitchell
removed support for the -DH flag but missed this.

Part of the -D options parsing is positionally sensitive, so in order to
be able to remove the 'H' option entirely I had to use a placeholder
character, and I chose '?'. This is because it is not isWORDCHAR(),
which means the preceding logic prevents it from being chosen anyway,
and thus it should be safe.

2 years agohv.c: ALWAYS perform in_collision check
Yves Orton [Sat, 5 Mar 2022 06:18:11 +0000 (07:18 +0100)]
hv.c: ALWAYS perform in_collision check

This is a critical patch. Any perl built with the previous code
without PERL_HASH_RANDOMIZE_KEYS would never perform a key split!

2 years agogh19010: add NOT_REACHED
Hugo van der Sanden [Fri, 4 Mar 2022 13:50:29 +0000 (13:50 +0000)]
gh19010: add NOT_REACHED

2 years agogh19010: simplify and expand inf/nan tests
Hugo van der Sanden [Sat, 26 Feb 2022 14:50:23 +0000 (14:50 +0000)]
gh19010: simplify and expand inf/nan tests

We know how grok results should vary with and without PERL_SCAN_TRAILING
both for inputs with trailing garbage and those without, so abstract
that out and test both cases for each input.

2 years agogh19010: regularize handling of trailing whitespace on inf/nan
Hugo van der Sanden [Sat, 26 Feb 2022 14:44:11 +0000 (14:44 +0000)]
gh19010: regularize handling of trailing whitespace on inf/nan

Always accept trailing whitespace when parsing Inf/NaN constructs, even
inside parens, without flagging as "trailing garbage".

Also fix off-by-one checking whether we reached the close-paren of
'nan(123)'.

2 years agogh19010: fix returns for Perl_grok_infnan
Hugo van der Sanden [Sun, 15 Aug 2021 14:34:12 +0000 (15:34 +0100)]
gh19010: fix returns for Perl_grok_infnan

Consistently honour what the docs have always promised:
  If an infinity or a not-a-number is recognized, C<*sp> will point to
  one byte past the end of the recognized string.  If the recognition fails,
  zero is returned, and C<*sp> will not move.

Additionally, restore Perl_grok_number_flags to allowing inf/nan with
trailing garbage only when called with PERL_SCAN_TRAILING; add notes
to the other two core callers to clarify that they always accept such
trailing garbage.

A small number of XS-APItest tests were modified to reflect the stricter
behaviour: "Infin" and "nanx" are now invalid without PERL_SCAN_TRAILING.

2 years agoAdd Brad Barden to the AUTHORS file
Karl Williamson [Fri, 4 Mar 2022 17:21:33 +0000 (10:21 -0700)]
Add Brad Barden to the AUTHORS file

2 years agoAdd PerlIO_readlink backcompat defines to Cws.xs
Leon Timmermans [Thu, 6 Jan 2022 23:31:42 +0000 (00:31 +0100)]
Add PerlIO_readlink backcompat defines to Cws.xs

2 years agoAdd tests to see if string-to-number conversion behaves correctly
TAKAI Kousuke [Thu, 17 Feb 2022 12:48:37 +0000 (21:48 +0900)]
Add tests to see if string-to-number conversion behaves correctly

I added these tests primarily to verify that my previous commit did
not introduce any behavioral change; these tests should not fail
even before that commit.

2 years agosv.c: reuse NV-to-IV/UV conversion code for SV-to-NV-to-IV/UV conversion
TAKAI Kousuke [Thu, 17 Feb 2022 10:16:23 +0000 (19:16 +0900)]
sv.c: reuse NV-to-IV/UV conversion code for SV-to-NV-to-IV/UV conversion

S_sv_2iuv_common() had two NV to IV/UV conversion code, one is used when
input is NOKp, another is used when converting a string to IV/UV via NV
(as long as NV_PRESERVES_UV is defined).  These two conversions should be
identical, so sharing one code will be clearer and make code a bit compact.

2 years agoMake sv_dump() (and Devel::Peek) escape PV contents with hex, not octal.
Felipe Gasper [Sat, 29 Jan 2022 02:35:34 +0000 (21:35 -0500)]
Make sv_dump() (and Devel::Peek) escape PV contents with hex, not octal.

This improves the readability of SV dumps for those more familiar with
hex than octal--which, in 2022, is probably an outsized majority of
programmers.

2 years agoregcomp.c: Replace RExC_parse_inc() like exprs not using UTF with RExC_parse_incf()
Yves Orton [Thu, 24 Feb 2022 14:32:17 +0000 (15:32 +0100)]
regcomp.c: Replace RExC_parse_inc() like exprs not using UTF with RExC_parse_incf()

Mostly RExC_parse mutations using UTF8SKIP(RExC_parse) use the UTF flag
to determine if they should increment by 1 or increment by the
UTF8SKIP() return value, but this one uses a different flag

2 years agoregcomp.c: Replace `RExC_parse += 2` with RExC_parse_inc_by(2)
Yves Orton [Thu, 24 Feb 2022 14:31:34 +0000 (15:31 +0100)]
regcomp.c: Replace `RExC_parse += 2` with RExC_parse_inc_by(2)

2 years agoregcomp.c: Replace `RExC_parse += x` with RExC_parse_inc_by(x)
Yves Orton [Thu, 24 Feb 2022 14:30:57 +0000 (15:30 +0100)]
regcomp.c: Replace `RExC_parse += x` with RExC_parse_inc_by(x)

2 years agoregcomp.c: Replace `RExC_parse += UTF ? UTF8_SAFE_SKIP(...) : 1` with RExC_parse_inc_...
Yves Orton [Thu, 24 Feb 2022 14:30:16 +0000 (15:30 +0100)]
regcomp.c: Replace `RExC_parse += UTF ? UTF8_SAFE_SKIP(...) : 1` with RExC_parse_inc_safe()

2 years agoregcomp.c: Replace `RExC_parse += (UTF) ? UTF8SKIP(RExC_parse) : 1` with RExC_parse_inc()
Yves Orton [Thu, 24 Feb 2022 14:29:24 +0000 (15:29 +0100)]
regcomp.c: Replace `RExC_parse += (UTF) ? UTF8SKIP(RExC_parse) : 1` with RExC_parse_inc()

2 years agoregcomp.c: Replace `RExC_parse += SKIP_IF_CHAR(...)` with RExC_parse_inc_if_char()
Yves Orton [Thu, 24 Feb 2022 14:28:20 +0000 (15:28 +0100)]
regcomp.c: Replace `RExC_parse += SKIP_IF_CHAR(...)` with RExC_parse_inc_if_char()

2 years agoregcomp.c: Replace `RExC_parse += UTF8SKIP(RExC_parse)` with RExC_parse_inc_utf8
Yves Orton [Thu, 24 Feb 2022 14:26:34 +0000 (15:26 +0100)]
regcomp.c: Replace `RExC_parse += UTF8SKIP(RExC_parse)` with RExC_parse_inc_utf8

2 years agoregcomp.c: Replace `RExC_parse = x` with RExC_parse_set(x)
Yves Orton [Thu, 24 Feb 2022 14:25:22 +0000 (15:25 +0100)]
regcomp.c: Replace `RExC_parse = x` with RExC_parse_set(x)

2 years agoregcomp.c: Replace `RExC_parse++` with RExC_parse_inc_by(1)
Yves Orton [Thu, 24 Feb 2022 14:21:00 +0000 (15:21 +0100)]
regcomp.c: Replace `RExC_parse++` with RExC_parse_inc_by(1)

2 years agoregcomp.c: Add utility macros to wrap mutations of RExC_parse
Yves Orton [Sat, 26 Feb 2022 03:56:45 +0000 (04:56 +0100)]
regcomp.c: Add utility macros to wrap mutations of RExC_parse

* RExC_parse_incf(flag)
* RExC_parse_inc()
* RExC_parse_inc_safef(flag)
* RExC_parse_inc_safe()
* RExC_parse_inc_utf8()
* RExC_parse_inc_if_char()
* RExC_parse_inc_by(n_octets)
* RExC_parse_set(to_ptr)

See comments in patch for explanation of each one.

2 years agoenable x64 -Duselongdouble build for all mingw-runtime versions.
sisyphus [Fri, 18 Feb 2022 02:15:04 +0000 (13:15 +1100)]
enable x64 -Duselongdouble build for all mingw-runtime versions.

See https://github.com/Perl/perl5/issues/18363

2 years agoregex_sets: Allow all legal flags in nested calls
Karl Williamson [Mon, 28 Feb 2022 22:41:27 +0000 (15:41 -0700)]
regex_sets: Allow all legal flags in nested calls

See https://github.com/Perl/perl5/issues/16779#issuecomment-563219424

This commit extends the flags accepted by nested calls to regex sets to
any legal set.  Previously it allowed only '^', as that is what an
actual compilation would return.  But as pointed out in the conversation
in that ticket, it's possible to detach flags from the rest of the
pattern, and to write equivalent ones in multiple ways.

This commit just changes one line to look for any legal flag, not
restricting it to '^'.

2 years agoperlrecharclass: Update regex sets pod
Karl Williamson [Thu, 24 Feb 2022 18:14:55 +0000 (11:14 -0700)]
perlrecharclass: Update regex sets pod

The pod didn't reflect restrictions on what can go into such a class.

2 years agoutf8.h: fixup signed/unsigned warning from UTF8_IS_REPLACEMENT
Yves Orton [Thu, 3 Mar 2022 11:15:03 +0000 (12:15 +0100)]
utf8.h: fixup signed/unsigned warning from UTF8_IS_REPLACEMENT

Added a SSize_t cast to the sizeof() call.

2 years agodoc: fix some typos
cuishuang [Thu, 3 Mar 2022 12:15:20 +0000 (20:15 +0800)]
doc: fix some typos

Signed-off-by: cuishuang <imcusg@gmail.com>
Committer: cuishuang is now a Perl author.

2 years agoregcomp.c: add comment that last_close_opp is dangerous yves/comment_about_last_close_opp 19487/head
Yves Orton [Thu, 3 Mar 2022 13:26:54 +0000 (14:26 +0100)]
regcomp.c: add comment that last_close_opp is dangerous

We use last_close_opp currently to track what close ops we have
encountered during study. Some of our optimizations may remove
the close op afterwards. So the "inner" pointer is not safe to
dereference. I will push a patch in the future to clean this up
somehow or another.

2 years agoregcomp.c: Reduce scope of experimental warnings with lookbehind
Yves Orton [Wed, 23 Feb 2022 06:06:22 +0000 (07:06 +0100)]
regcomp.c: Reduce scope of experimental warnings with lookbehind

The only case where we need to warn about variable length lookbehind is
when capturing buffers are involved.

2 years agoregcomp.c: in study_chunk() properly pass down SCF_TRIE_DOING_RESTUDY flag
Yves Orton [Wed, 2 Mar 2022 11:47:37 +0000 (12:47 +0100)]
regcomp.c: in study_chunk() properly pass down SCF_TRIE_DOING_RESTUDY flag

This is necessary so that warnings generated during study_chunk() do not
get emitted twice. At the same time fix some "int" flags parameters that
should be U32.

2 years agoregcomp.c: track last close *op*, not just its index in study_chunk()
Yves Orton [Wed, 2 Mar 2022 09:45:02 +0000 (10:45 +0100)]
regcomp.c: track last close *op*, not just its index in study_chunk()

In the study_data_t struct the member last_closep is a pointer to a
SSize_t which is used to store the arg (which buffer slot it represents,
eg, $1 or $3 at the perl level) from the last close regop we encountered
during the scan process.

The arg might be duplicated between different opcodes in the face of
branch-reset /(?| (...) | (...) )/ where both capture buffers map to the
same perl variable (eg, $1).

This patches adds a new, very similar member, regnode **last_close_opp,
which tracks the close op itself instead of its arg.

In a future commit we could replace last_closep entirely, and extract
the comparable value from the regnode pointed to by last_close_opp when
needed, but for this patch I am sticking with tracking both at the same
time as it is simpler and safer.

This enables us to detect if someone has used parens inside of a
parenthesized construct reliably in the fact of branch reset.

This is in preparation for dealing with experimental variable length
warnings properly, which will come in a subsequent patch. It also should
help long run to fixing other bugs related to branch-reset.

NB: Really a bunch of this should turn into some kind of macro to
    simplify the code and ensure that this is done reliably without a
    lot of repeated similar but not quite identical logic. But that too
    is not appropriate for this PR.

2 years agoregcomp.c: rename "fake" where it used in recursive study_chunk() calls
Yves Orton [Wed, 2 Mar 2022 08:54:35 +0000 (09:54 +0100)]
regcomp.c: rename "fake" where it used in recursive study_chunk() calls

All instances of the fake variable are used inside of data_fake.last_closep
structures, so rename them from "fake" to "fake_last_close" so it is obvious
what they are used for. Note the 'p' in last_closep means "pointer", eg
it means "pointer to last_close", so the "fake" version is called
"fake_last_close" as well.

2 years agoregcomp.c: rename "fake" argument in main entry points to study_chunk()
Yves Orton [Wed, 2 Mar 2022 08:50:17 +0000 (09:50 +0100)]
regcomp.c: rename "fake" argument in main entry points to study_chunk()

There are way too many uses of "fake" as a variable in this code, this
renames two of them to improve clarity. Both are used for the "deltap"
argument to study_chunk() which is not used in the top level calls.

2 years agoregcomp.c: S_study_chunk() clean up args and docs
Yves Orton [Wed, 2 Mar 2022 08:48:13 +0000 (09:48 +0100)]
regcomp.c: S_study_chunk() clean up args and docs

Put one argument per line, add a comment per argument,
and remove docs for long removed argument "recursed".

2 years agoAdd ASSERT_IS_PTR macro
Karl Williamson [Wed, 2 Mar 2022 18:11:50 +0000 (11:11 -0700)]
Add ASSERT_IS_PTR macro

To make sure at compile time that its argument is a ptr

2 years agoAdd 'ASSERT_IS_LITERAL' macro
Karl Williamson [Wed, 2 Mar 2022 18:08:58 +0000 (11:08 -0700)]
Add 'ASSERT_IS_LITERAL' macro

This is intended to make it obvious what this relatively obscure C
construct is doing.

2 years agoCorrect one spelling error
James E Keenan [Wed, 2 Mar 2022 20:20:03 +0000 (20:20 +0000)]
Correct one spelling error

Eliminate hard tabs and trailing whitespace from two files.

Increment $VERSION.

2 years agomakerel: use Digest::SHA to print sha256sum
Michiel Beijen [Sat, 5 Feb 2022 20:23:34 +0000 (21:23 +0100)]
makerel: use Digest::SHA to print sha256sum

Since 6bd57ce23e the release announcement uses sha256 instead of sha1.
It would be helpful if makerel would output sha256 as well.

Previously, makerel tried to find a sha1 'executable' and shell out
for printing the shasum. Digest::SHA is a core module, so let's use
that instead.

2 years agopad.c: Fix GH Issue #19463, -DXv fails assert when dumping anonymous constant sub
Yves Orton [Sun, 27 Feb 2022 02:20:42 +0000 (03:20 +0100)]
pad.c: Fix GH Issue #19463, -DXv fails assert when dumping anonymous constant sub

Anonymous constant subs were changed to be implemented internally as
XSUBs in 5.21.6, commit 1567c65ac069266bfe65959430c185babd476538.
This broke DEBUGGING perls running under -DXv which weren't taught
about the new implementation. In ed958fa3156084f3cf4d8c4768716d9e1a11ce91
strict.pm also was changed to use such subs, which then breaks many
uses of -DXv.

See t/run/switchDx.t for an example of code that would trigger this that
does not depend on strict.pm

This fixes the problem and adds a test for -Dx.

2 years agoperl.c: zero stacks on creation
Yves Orton [Wed, 2 Mar 2022 14:31:59 +0000 (15:31 +0100)]
perl.c: zero stacks on creation

I think not initializing these to zero is a false economy, Felipe Gasper brought
this up that it made debugging issues with the stack confusing. We only do this once
per process and zeroing memory is prety cheap so it make sense to me to zero
the stacks on startup.

2 years agoregcomp.c: Check non-NULL before dereferencing
Karl Williamson [Wed, 2 Mar 2022 15:02:04 +0000 (08:02 -0700)]
regcomp.c: Check non-NULL before dereferencing

These ptrs can both be NULL, so skip this DEBUG statement if so.

2 years agoMake sv_len_utf8_nomg() public
Karl Williamson [Mon, 28 Feb 2022 16:40:26 +0000 (09:40 -0700)]
Make sv_len_utf8_nomg() public

The get-magic version of this has long been available, but not the no magic.
It turns out that ppport.h does make both available, so any module
using that would be able to use it anyway, without even noticing that it
isn't supported by core.

I see no reason for this to not be public; the original commit message
did not indicate such a reason, and it is effectively public anyway via
ppport.h.

(This is the only non-publically accessible function that ppport.h
furnishes; I'm working on a patch to have it warn of future instances
creeping in.)

2 years agoFix UTF8_IS_REPLACEMENT() and add tests
Karl Williamson [Tue, 1 Mar 2022 18:53:38 +0000 (11:53 -0700)]
Fix UTF8_IS_REPLACEMENT() and add tests

This macro relied on a now-removed other macro in 2019,
216dc346ceeeb9b6ba0fdd470ccfe4f8b2a286c4.  Fix it and add tests.

This bug was caught by Devel::PPPort

2 years agowrap any existing import in Attribute::Handlers' injected import
Graham Knop [Tue, 1 Mar 2022 07:31:03 +0000 (08:31 +0100)]
wrap any existing import in Attribute::Handlers' injected import

Some modules using Attribute::Handlers autotie feature have their own
import method. When injecting an import method, attempt to wrap anything
that exists, either in the class directly or in a parent class.

We can't detect parent classes at injection time, because @ISA may
change, and this is actually common since users of Exporter will add it
as a parent class at module runtime, while Attribute::Handlers injection
would happen first during compilation.

A better approach could involve using next::can from mro, but that also
requires Sub::Util::set_subname, and Attribute::Handlers is dual life
and currently supports 5.6.

2 years agoMerge branch 'bisection-example-20220227' into blead
James E Keenan [Sun, 27 Feb 2022 17:13:36 +0000 (17:13 +0000)]
Merge branch 'bisection-example-20220227' into blead

For: https://github.com/Perl/perl5/pull/19468

2 years agoExplanation of rationale for two stages 19468/head
Hugo van der Sanden [Sun, 27 Feb 2022 17:09:24 +0000 (17:09 +0000)]
Explanation of rationale for two stages

Committer: small textual modifications

2 years agoAdd example of two-stage bisection
James E Keenan [Sun, 27 Feb 2022 15:10:04 +0000 (15:10 +0000)]
Add example of two-stage bisection

Based on work in https://github.com/Perl/perl5/issues/19463

Correction on what each investigator did.

2 years agoPorting/epigraphs - Add epigraph for 5.34.1-RC1
Steve Hay [Sun, 27 Feb 2022 14:50:15 +0000 (14:50 +0000)]
Porting/epigraphs - Add epigraph for 5.34.1-RC1

2 years agoPorting/epigraphs.pod - Add missing announcement links
Steve Hay [Sun, 27 Feb 2022 14:45:38 +0000 (14:45 +0000)]
Porting/epigraphs.pod - Add missing announcement links

2 years ago5.34.1-RC1 today
Steve Hay [Sun, 27 Feb 2022 12:10:04 +0000 (12:10 +0000)]
5.34.1-RC1 today

2 years agoAiming for 5.34.1 in a fortnight
Steve Hay [Sun, 27 Feb 2022 12:09:36 +0000 (12:09 +0000)]
Aiming for 5.34.1 in a fortnight

2 years agofix typos in Attribute::Handlers __CALLER__ docs
Graham Knop [Fri, 25 Feb 2022 09:42:26 +0000 (10:42 +0100)]
fix typos in Attribute::Handlers __CALLER__ docs

2 years agofix __CALLER__ handling in Attribute::Handlers
Graham Knop [Fri, 25 Feb 2022 09:08:30 +0000 (10:08 +0100)]
fix __CALLER__ handling in Attribute::Handlers

Attribute::Handlers supports a __CALLER__ token when declaring autotie
attributes. This is meant to create the attribute in the caller of the
class it is used in. The only reliable way for this to work requires
creating an import method in the calling class. Instead,
Attribute::Handlers was trying to walk up the call stack from when its
own import would be called. This used to partially work, at least enough
to be deceptive. Checking the caller deeper in the call stack of
Attribute::Handlers would allow the __CALLER__ attribute to work only
for the first time the module using it was called. Any future users
would not re-compile the module, so they would not re-invoke
Attribute::Handlers' import method, and would not get the autotie
attribute defined.

This attempt to find the caller's caller also started failing as of
f6387cff9cb31db4cf18c8641917ea4639ac2b65.

Fix the handling of __CALLER__ by creating an import method in the
caller if it is used, so that users of the calling module will reliably
get the attribute defined.

2 years agoperlapi: Improve pod for Perl_na
Karl Williamson [Thu, 17 Feb 2022 20:30:49 +0000 (13:30 -0700)]
perlapi: Improve pod for Perl_na

2 years agoAdditional email address for Curtis Poe
James E Keenan [Wed, 23 Feb 2022 23:14:25 +0000 (18:14 -0500)]
Additional email address for Curtis Poe

2 years agoUpdate perldebug.pod to explain detection of running under the debugger
Ovid [Wed, 23 Feb 2022 14:48:06 +0000 (15:48 +0100)]
Update perldebug.pod to explain detection of running under the debugger

2 years agoAdd alternative email for Curtis Poe
Karl Williamson [Wed, 23 Feb 2022 17:54:49 +0000 (10:54 -0700)]
Add alternative email for Curtis Poe

2 years agoregcomp.c: Properly optimize verb style lookahead/lookbehind
Yves Orton [Mon, 21 Feb 2022 12:21:44 +0000 (13:21 +0100)]
regcomp.c: Properly optimize verb style lookahead/lookbehind

This introduces the full set of optimizations for verb style
lookahead and lookbehind:

Eg. (*nla:) and (*negative_lookahead:)  are equivalent to OPFAIL,
and (*plb:) and (*positive_lookbehind:) are equivalent to NOTHING,
and (*nlb:) and (*negative_lookbehind:) are equivalent to OPFAIL,
and (*pla:) and (*positive_lookahead:)  are equivalent to NOTHING.

At the same time it fixes a very minor bug that RExC_seen_zerowidth
and RExC_in_lookaround should not be incremented when
(*negative_lookahead:) is optimized to OPFAIL.

This patch makes the flag setting and increments consistent with the
logic for (?<=) and (?<!) and (?=) and (?!).

2 years agoregcomp.c: consistent NOTHING/OPFAIL optimizations for lookaround
Yves Orton [Mon, 21 Feb 2022 06:14:52 +0000 (07:14 +0100)]
regcomp.c: consistent NOTHING/OPFAIL optimizations for lookaround

Add funcs to parse empty constructs which boil down to OPFAIL or NOTHING,
and then consistently use them while parsing lookahead and lookbehind.

This allows us to eliminate duplicated code and optimize the various cases
which boil down to these constructs.

Eg. (?!) and (?<!) are equivalent to OPFAIL ops,
and (?=) and (?<=) are equivalent to NOTHING ops.

This patch does not deal with the (* ... ) forms, that will come in a
follow up.

One advantage of this optimization is it does not need to set the various
special flags related to lookaround as they aren't really lookaround ops.

As a bonus this also improves the error messages from incomplete patterns,
and add tests for various error messages.

Note the functions are given awkward but shortish names so they are not
always forced to be line broken. I would prefer to name them something
more descriptive, but that would make their use harder to read by
forcing line breaks. So I chose to use an abbreviation.

2 years agoregcomp.c: fix long lines or unnecessary line breakage
Yves Orton [Mon, 21 Feb 2022 12:18:06 +0000 (13:18 +0100)]
regcomp.c: fix long lines or unnecessary line breakage

Vertical space is more expensive than horizontal, don't waste it when we
are under the recommended line length.

At the same time, rewording a comment so its shorter than the line length
keeps us compliant. (I'd prefer we didnt have to do this, but ze rulez
are ze rulez!)

Also fixes indents and make the error message coding style consistent.

2 years agoregex engine: Issue #19168 - Fix variable length lookbehind matches
Yves Orton [Sun, 20 Feb 2022 09:38:09 +0000 (10:38 +0100)]
regex engine: Issue #19168 - Fix variable length lookbehind matches

We were not validating that when (?<=a|ab) matched that the right hand
side of the match lined up with the position of the assertion. Similar
for (?<!a|ab) and related patterns, eg, (*positive_lookbehind:).
Note these problems do NOT affect lookahead.

Part of the difficulty here was that the SUCCEED node was serving too
many purposes, necessitating a new regop LOOKBEHIND_END.

Includes more tests for various lookahead or lookbehind cases.

2 years agoregcomp.c: add whitespace to avoid =* as a symbol
Yves Orton [Sun, 20 Feb 2022 01:22:27 +0000 (02:22 +0100)]
regcomp.c: add whitespace to avoid =* as a symbol

GNU indent warns that this is ambiguous, and the spaces make it more
legible anyway.

2 years agoPerl_gv_init_pvn() must handle a stash holding the value -1
Nicholas Clark [Tue, 22 Feb 2022 20:35:17 +0000 (20:35 +0000)]
Perl_gv_init_pvn() must handle a stash holding the value -1

As a space optimisation, where possible, sub declarations are stored in the
symbol table as a plain scalar, and converted to a PVGV, PVCV pair only when
needed.

A regression was introduced by the recently merged commit bb5bc97fde9ef2f1:
    Don't set SVf_POK in Perl_sv_2pv_flags() when caching the string for an IV.

    This permits XS code (such as serialisers) to distinguish between values
    that started as IVs but had a string representation cached, and values that
    started as PVs but had an (exact) integer representation cached.

    As implemented, the change in flags means that Perl_sv_2pv_flags() will be
    entered each time the string for an IV is wanted. The next commit will fix
    SvPV() and the other macros to avoid calling Perl_sv_2pv_flags() more than
    once, restoring the previous behaviour.

Specifically, code which reduces to this:

     sub foo;
     $::{foo} . "";
     eval q{*foo = []};

changed behaviour (to an assertion failure)

Previously the runtime behaviour of the middle line (simplifying slightly)
was to convert the IV -1 to the PVIV "-1". The third line would then see
this as a(n illegal) prototype "-1", but the code in Perl_gv_init_pvn()
would diligently move this across to the PVCV it created, and finish with a
structurally valid PVGV and PVCV

With the recent commit, the second line would still convert to PVIV, but no
longer set the flag bit SVf_POK. This meant that with this same test case,
the SvPOK() test in Perl_gv_init_pvn() was no longer true, and a different
code path was taken, resulting in broken assumptions and an assertion
failure (when assertions are enabled).

Fixing this regression also fixes a long standing bug, likely present since
the commit from 1998 that added this space optimisation. This pathological
code:

     sub foo;
     $::{foo} . "";
     eval q{ sub foo {} };

use to incorrectly warn:

    Prototype mismatch: sub main::foo (-1) vs none at (eval 1) line 1.

because the placeholder -1 for "no prototype" had been converted to a
string, that string then copied because it seemed to be a placeholder
prototype, and then the warning issued on the mistaken incorrect prototype.

2 years agoPOD typo fix: suroutine -> subroutine
Matthew Horsfall [Mon, 21 Feb 2022 13:39:48 +0000 (08:39 -0500)]
POD typo fix: suroutine -> subroutine

2 years agouse neutral form for parameter
Bernd [Mon, 21 Feb 2022 08:46:23 +0000 (09:46 +0100)]
use neutral form for parameter

User $val instead of $sv as for the other parameter in the samples.

For: https://github.com/Perl/perl5/pull/19445

Committer:  Increment package version

2 years agofix typo in perl5358delta
Bernd [Mon, 21 Feb 2022 08:13:33 +0000 (09:13 +0100)]
fix typo in perl5358delta

Remove doubled line in the "Testing" section.

For: https://github.com/Perl/perl5/pull/19443

Committer: Bernd is now a Perl author

2 years agoprepare Module::CoreList for 5.35.10
reneeb [Sun, 20 Feb 2022 16:46:06 +0000 (16:46 +0000)]
prepare Module::CoreList for 5.35.10

2 years agobump version for 5.35.10
reneeb [Sun, 20 Feb 2022 16:08:42 +0000 (16:08 +0000)]
bump version for 5.35.10

2 years agoadd new perldelta for 5.35.10
reneeb [Sun, 20 Feb 2022 15:16:20 +0000 (15:16 +0000)]
add new perldelta for 5.35.10

2 years agotick off release 5.35.9 in release schedule
reneeb [Sun, 20 Feb 2022 15:13:04 +0000 (15:13 +0000)]
tick off release 5.35.9 in release schedule

2 years agoupdate epigraphs with 5.35.9 entry
reneeb [Sun, 20 Feb 2022 15:03:49 +0000 (15:03 +0000)]
update epigraphs with 5.35.9 entry

2 years agoAdd new release to perlhist v5.35.9
reneeb [Sun, 20 Feb 2022 09:53:46 +0000 (09:53 +0000)]
Add new release to perlhist

2 years agofixed POD warnings in perldelta, regenerated known_pod_issues.dat
reneeb [Sun, 20 Feb 2022 09:53:11 +0000 (09:53 +0000)]
fixed POD warnings in perldelta, regenerated known_pod_issues.dat

2 years agofinalize perldelta for 5.35.9
reneeb [Sun, 20 Feb 2022 09:27:56 +0000 (09:27 +0000)]
finalize perldelta for 5.35.9

2 years agoUpdate Module::CoreList for 5.35.9
reneeb [Sun, 20 Feb 2022 08:53:24 +0000 (08:53 +0000)]
Update Module::CoreList for 5.35.9

2 years agoUpdate AUTHORS list for 5.35.9
reneeb [Sun, 20 Feb 2022 07:56:08 +0000 (07:56 +0000)]
Update AUTHORS list for 5.35.9

2 years agoUpdate Devel-PPPort to 3.64
reneeb [Sun, 20 Feb 2022 07:50:39 +0000 (07:50 +0000)]
Update Devel-PPPort to 3.64

2 years agoupdate Porting/Maintainers.pl (update Scalar-List-Utils version
reneeb [Sun, 20 Feb 2022 06:54:18 +0000 (06:54 +0000)]
update Porting/Maintainers.pl (update Scalar-List-Utils version

2 years agoupdate Scalar-List-Utils to 1.61
reneeb [Sun, 20 Feb 2022 06:40:14 +0000 (06:40 +0000)]
update Scalar-List-Utils to 1.61

2 years agoAdd 'signatures' to :5.36 feature bundle
Paul "LeoNerd" Evans [Tue, 15 Feb 2022 18:54:29 +0000 (18:54 +0000)]
Add 'signatures' to :5.36 feature bundle

2 years agoUpdate various documentation files
Paul "LeoNerd" Evans [Tue, 15 Feb 2022 17:04:12 +0000 (17:04 +0000)]
Update various documentation files

2 years agoRemove 'no warnings experimental::signatures' from support files
Paul "LeoNerd" Evans [Tue, 15 Feb 2022 15:02:03 +0000 (15:02 +0000)]
Remove 'no warnings experimental::signatures' from support files

2 years agoDon't emit experimental::signatures warning (closes #13681)
Paul "LeoNerd" Evans [Tue, 15 Feb 2022 13:46:29 +0000 (13:46 +0000)]
Don't emit experimental::signatures warning (closes #13681)

2 years agoperl5db.pl needs to use :prototype() attribute to set sub prototypes
Paul "LeoNerd" Evans [Tue, 15 Feb 2022 18:54:11 +0000 (18:54 +0000)]
perl5db.pl needs to use :prototype() attribute to set sub prototypes