This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Yves Orton [Fri, 11 Feb 2022 05:30:45 +0000 (06:30 +0100)]
regcomp.c,re.pm: Remove "offsets" debugging code
This code was added by Mark Jason Dominus to aid a regex debugger
he wrote for ActiveState. The basic premise is that every opcode
in a regex can be attributed back to a contiguous sequence of characters
that make up the pattern. This assumption has not been true ever since
the "jump" TRIE optimizations were added to the engine.
I spoke to MJD many years ago about whether it was ok to remove this
from the regex engine and he said he had no objections.
An example of a pattern that cannot be handled correctly by this logic is
/(?: a x+ | b y+ | c z+ )/x
where the
(?:a ... | b ... | c ...)
parts will now be handled by the TRIE logic and not by the BRANCH/EXACT
opcodes that it would have been in the past. The offset debug output
cannot handle this type of transformation, and produce nonsense output
that mention opcodes that have been optimized away from the final program.
The regex compiler is complicated enough without having to maintain this
logic. There are essentially no tests for it, and the few tests that do
cover it do so as a byproduct of testing other things. Despite the offsets
logic only being used in debug supporting it does have a cost to non-debug
logic as various internal routines include parameters related to it that
are otherwise unused.
Note this output is only usable or visible by enabling special flags
in re.pm, there is no formal API to access it short of parsing the
output of the debug mode of the regex engine, which has changed multiple
time over the past years.
Yves Orton [Wed, 16 Feb 2022 02:53:38 +0000 (03:53 +0100)]
perlreguts.pod: synchronize regexp_internal docs with code
Various changes have been made to struct regexp_internal over
time which have not been documented. This updates the docs to
match the code as it is now in preparation of changing the docs
in subsequent commits.
Ricardo Signes [Fri, 18 Feb 2022 14:48:57 +0000 (09:48 -0500)]
release schedule: update the road to v5.36
Christopher Yeleighton [Thu, 30 Dec 2021 01:06:38 +0000 (02:06 +0100)]
Document Hash::Util::hash_value($string, $seed)
Returns the hash value as if computed with a different seed.
Karl Williamson [Fri, 18 Feb 2022 01:18:37 +0000 (18:18 -0700)]
Christopher Yeleighton is a Perl author
James Raspass [Tue, 25 Jan 2022 10:35:38 +0000 (10:35 +0000)]
Tie::SubstrHash - Add strict & warnings
James Raspass [Tue, 25 Jan 2022 10:34:52 +0000 (10:34 +0000)]
Tie::SubstrHash - Replace sub ceil with builtin::ceil
James Raspass [Tue, 25 Jan 2022 10:30:51 +0000 (10:30 +0000)]
Tie::SubstrHash - Consistently deref with the arrow op
James Raspass [Tue, 25 Jan 2022 11:04:22 +0000 (11:04 +0000)]
Tie::SubstrHash - Use ||= and //=
James Raspass [Tue, 25 Jan 2022 10:15:25 +0000 (10:15 +0000)]
Tie::SubstrHash - Replace tabs with spaces
Karl Williamson [Thu, 17 Feb 2022 02:23:35 +0000 (19:23 -0700)]
podcheck: Make sure digest gets a byte string
Digest only accepts bytes; this makes sure it doesn't get UTF-8 encoded
characters.
Karl Williamson [Thu, 17 Feb 2022 02:21:09 +0000 (19:21 -0700)]
Add link to String::Util to podcheck db
Karl Williamson [Thu, 17 Feb 2022 02:21:47 +0000 (19:21 -0700)]
perlrecharclass: Update Unicode version reference
The list is still valid in the current Unicode version, which is much
later than the one listed as it being valid for. This could have caused
concern that it was out-dated.
Yves Orton [Wed, 16 Feb 2022 09:20:05 +0000 (10:20 +0100)]
Porting/GitUtils.pm: add missing package declaration
TAKAI Kousuke [Thu, 13 Jan 2022 17:00:33 +0000 (02:00 +0900)]
POSIX.pod: wording fix in the description of testing NaN-ness
Equality operators test equality, not equivalence.
TAKAI Kousuke [Thu, 13 Jan 2022 16:48:24 +0000 (01:48 +0900)]
POSIX.pod: add link and small example for the description for NaN-ness test
TAKAI Kousuke [Thu, 13 Jan 2022 16:05:53 +0000 (01:05 +0900)]
POSIX.pod: NaN-ness should be able to be tested by "=="
A note in the description of "isnan" used to say that NaN-ness
cannot be tested with equality operator, but it should be possible.
Dave Cross [Mon, 24 Jan 2022 17:11:50 +0000 (17:11 +0000)]
lib/sigtrap.pm: Documentation improvements
As suggested by GW Haywood. See
https://www.nntp.perl.org/group/perl.perl5.porters/2022/01/msg262533.html
For: https://github.com/Perl/perl5/pull/19365
zhmylove [Tue, 15 Feb 2022 15:11:03 +0000 (18:11 +0300)]
perlop.pod: Fix typo in smartmatch example
Committer: Sergey Zhmylove is now a Perl author
For: https://github.com/Perl/perl5/pull/19422
Tomasz Konojacki [Tue, 15 Feb 2022 17:24:31 +0000 (18:24 +0100)]
revert to windows-2019 in GitHub Actions (for now)
It seems the changes in windows-latest (windows-2022) image broke our
builds.
Paul "LeoNerd" Evans [Mon, 7 Feb 2022 18:08:19 +0000 (18:08 +0000)]
Add 'isa' to 'use feature :5.35'
Paul "LeoNerd" Evans [Mon, 7 Feb 2022 17:26:13 +0000 (17:26 +0000)]
No longer print experimental::isa warning (closes #18754)
Karl Williamson [Sat, 12 Feb 2022 19:43:00 +0000 (12:43 -0700)]
toke.c: Add a couple const to decls
Karl Williamson [Sat, 12 Feb 2022 19:41:16 +0000 (12:41 -0700)]
parser.h: add to comments
Karl Williamson [Mon, 14 Feb 2022 23:53:47 +0000 (16:53 -0700)]
toke.c: I32 considered harmful; change to 'int'
Dagfinn Ilmari Mannsåker [Mon, 14 Feb 2022 21:50:25 +0000 (21:50 +0000)]
Mark feature.h and lib/feature.pm as generated
David Cantrell [Wed, 2 Feb 2022 13:08:00 +0000 (13:08 +0000)]
fix looking up letters by their name only so that we search scripts
in the order the user asked for
David Cantrell [Wed, 2 Feb 2022 13:07:11 +0000 (13:07 +0000)]
add tests that when we import more than one script, we look for
letters in those scripts in the specified order
David Cantrell [Thu, 27 Jan 2022 09:00:34 +0000 (09:00 +0000)]
bump $VERSION
David Cantrell [Wed, 26 Jan 2022 23:34:09 +0000 (23:34 +0000)]
detect and warn when the user asks for short names for multiple
charsets which have letters with the same name
David Cantrell [Wed, 26 Jan 2022 23:33:45 +0000 (23:33 +0000)]
tests to detect when the user asks for short names for multiple
charsets which have letters with the same name
Hugo van der Sanden [Sun, 13 Feb 2022 15:01:33 +0000 (15:01 +0000)]
Sort tests in t/porting/dual-life.t
This give a non-obvious order, since we're sorting on the location of the
distribution rather than the installation location mentioned in the test
legend, but at least it will be consistent (at a given commit) rather
than dependent on directory order.
Paul "LeoNerd" Evans [Mon, 7 Feb 2022 16:10:50 +0000 (16:10 +0000)]
Might as well just do numerical comparisons against shortver rather than creating new temporary "version" objects
Paul "LeoNerd" Evans [Mon, 7 Feb 2022 16:35:43 +0000 (16:35 +0000)]
Add to perldeprecation.pod
Paul "LeoNerd" Evans [Mon, 7 Feb 2022 19:01:30 +0000 (19:01 +0000)]
Add to perldelta.pod
Paul "LeoNerd" Evans [Sat, 5 Feb 2022 02:20:13 +0000 (02:20 +0000)]
Print a deprecation warning if downgrading to a use VERSION below v5.11
Paul "LeoNerd" Evans [Sat, 5 Feb 2022 02:05:56 +0000 (02:05 +0000)]
Add a PL_prevailing_version interpreter var
Save/restore PL_prevailing_version at SAVEHINTS time
Have PL_prevailing_version track the applied use VERSION currently in scope
TAKAI Kousuke [Sat, 12 Feb 2022 05:18:44 +0000 (14:18 +0900)]
Add tests for string "-Inf" to IV conversion.
While a numeric -Inf is treated as IV_MIN in IV context (such as
operands for bitwise operators under "use integer"), string "-Inf"
used to yield some random (zero, or previously assigned) value in
such context.
TAKAI Kousuke [Wed, 9 Feb 2022 13:42:56 +0000 (22:42 +0900)]
sv.c: String "Inf" is now consistently converted to IV/UV
S_sv_2iuv_common() used to fail to set IV/UV slot on direct conversion
from string "Inf" to IV/UV, so such conversion would return garbage on
the memory. Now it will return the same result with two-staged
conversions, string to NV first and then NV to IV/UV.
Karl Williamson [Thu, 10 Feb 2022 20:40:05 +0000 (13:40 -0700)]
t/porting/diag.t: Fix typo in comment
Paul "LeoNerd" Evans [Tue, 8 Feb 2022 17:06:03 +0000 (17:06 +0000)]
Document that $^S is 1 inside a try block
Dagfinn Ilmari Mannsåker [Mon, 7 Feb 2022 18:11:17 +0000 (18:11 +0000)]
Update perldiag and perldeprecation for features removed in 5.30
Remove the perldiag entry for `my` in false conditional, and change
the perldiag entries to past tense.
Also correct the description of what actually happened to
`File::Glob::glob()`.
Dagfinn Ilmari Mannsåker [Mon, 7 Feb 2022 18:18:05 +0000 (18:18 +0000)]
Mark lib/warnings.pm and warnings.h as generated
Karl Williamson [Wed, 2 Feb 2022 03:17:59 +0000 (20:17 -0700)]
Update perlhactips for bool changes
This changes this doc to reflect the changes in the past few commits
Karl Williamson [Wed, 2 Feb 2022 03:05:49 +0000 (20:05 -0700)]
Simplify cBOOL defn
This existed because there wasn't a compiler bool necessarily, and
made complicated to workaround a bug in an AIX compiler as of 2010-ish.
Now that C99 is required, there always is a bool type; we don't know if
the bug existed in a C99 mode for the broken compiler, and sufficient
time has passed that it should have been fixed nonetheless.
This was tested on
IBM XL C/C++ for AIX, V12.1 (5765-J02, 5725-C72)
Version: 12.01.0000.0012
which dates to about 2012.
Karl Williamson [Wed, 2 Feb 2022 03:03:46 +0000 (20:03 -0700)]
Remove HAS_BOOL
This is no longer used in core. It occurs twice in metacpan, both to
define it so as to fool core into thinking it is there; hence it isn't
actually used at all in cpan.
Karl Williamson [Wed, 2 Feb 2022 02:50:45 +0000 (19:50 -0700)]
Remove PERL_BOOL_AS_CHAR uses; always define HAS_BOOL
Now that C99 is required, bool is always defined, so HAS_BOOL should
also always be defined.
PERL_BOOL_AS_CHAR was used to workaround problems when no bool type
existed, so it is obsolete, and in fact perl won't compile if
PERL_BOOL_AS_CHAR is #defined. So remove it completely from being
looked at.
Branislav Zahradník [Thu, 23 Dec 2021 22:27:18 +0000 (23:27 +0100)]
Use `optexpr` in anonymous to reduce number of symbols
Branislav Zahradník [Thu, 23 Dec 2021 22:25:49 +0000 (23:25 +0100)]
Unify optional rules
- start with `opt` (renamed `siglistornull`)
- employ bison's default rule whenever possible
Branislav Zahradník [Thu, 23 Dec 2021 22:24:52 +0000 (23:24 +0100)]
Introduce rule `empty` returning NULL
to save few keystrokes ...
Branislav Zahradník [Thu, 23 Dec 2021 22:24:09 +0000 (23:24 +0100)]
Gather all MY variants into single rule
Branislav Zahradník [Thu, 23 Dec 2021 22:20:01 +0000 (23:20 +0100)]
Favour switch over if/else if to improve readability
Branislav Zahradník [Thu, 23 Dec 2021 22:19:43 +0000 (23:19 +0100)]
Cleanup remnants after distinguising C- and perly- literals
Paul "LeoNerd" Evans [Sat, 5 Feb 2022 13:43:43 +0000 (13:43 +0000)]
Expansions of PERLVAR* in intrpvar.h should not end in semicolons
Tomasz Konojacki [Fri, 4 Feb 2022 17:18:08 +0000 (18:18 +0100)]
make autodoc.pl and makedef.pl understand the I embed.fnc flag
It's needed in case a publicly visible PERL_STATIC_FORCE_INLINE
function is added.
Paul "LeoNerd" Evans [Thu, 3 Feb 2022 17:17:46 +0000 (17:17 +0000)]
embedvar.h is a generated file
Hugo van der Sanden [Thu, 3 Feb 2022 02:26:07 +0000 (02:26 +0000)]
Augment overload::Method docs
Karl Williamson [Sat, 22 Jan 2022 21:41:27 +0000 (14:41 -0700)]
toke.c: Fix potential C sign error
Taking (UV)(* char) isn't what was meant. Instead it should be
(UV) * (U8 *)(char).
(and the UV cast becomes irrelevant in this case).
If the C compiler defaults char to unsigned, it doesn't matter. Nor
does it matter if the char value is positive. But it gives the wrong
result when 'char' means 'signed char' and the value is negative.
Experimentally adding non-ASCII brackets to this code showed up this
error.
Karl Williamson [Thu, 13 May 2021 14:50:23 +0000 (08:50 -0600)]
Refactor utf8 to code point conversion
Most such conversions occur in the inlined function
Perl_utf8n_to_uvchr_msgs(), which several macros like utf8n_to_uvchr()
expand to.
This commit effectively removes a conditional from inside the loop, and
avoids some conditionals when converting the common case of the input
being UTF-8 invariant (ASCII on ASCII platforms).
Prior to this commit, the code did something different the first time
through the loop than the other times. By hoisting that to pre-loop
initialization, that conditional is removed from each iteration. That
meant rearranging the loop to be a while(1), and have its exit
conditions in the middle.
All calls to this function from the Perl core pass in a non-empty
string. But outside calls could conceivably pass an empty one which
could lead to reading outside the buffer. An extra check is added to
non-core calls, as is already done elsewhere.
This change means that calls from core execute no more conditionals than
the typical:
if (UTF8_IS_INVARIANT(*s)) {
code_point = *s;
}
else {
code_point = utf8n_to_uvchr(s, ...)
}
I'm therefore thinking these can now just be replaced by the simpler
code_point = utf8n_to_uvchr(s, ...)
without a noticeable hit in performance. The essential difference is
that the former gets its code point from the string already being
examined, and the latter looks up data in a 450 byte static array that
is referred to constantly, so is likely to be cached.
Karl Williamson [Wed, 2 Feb 2022 01:58:08 +0000 (18:58 -0700)]
builtin.c: Fix up 730f927
That commit got pushed without a needed fix.
Karl Williamson [Wed, 2 Feb 2022 01:58:08 +0000 (18:58 -0700)]
builtin.c: Use correct 32bit printing format
Perl has no convenient way to portably print values that are explicitly
32 bit: I32 and U32. This is because Configure for some platforms makes
these longs (even if an int would do) and for others they end up being
ints.
The best we can do, without other changes, is use IVdf or UVdf and cast
the values to IV or UV.
Yves Orton [Sun, 23 Jan 2022 08:58:54 +0000 (09:58 +0100)]
Test for Issue #19250, assert fail with Debug=>ALL
Michiel Beijen [Tue, 1 Feb 2022 21:30:00 +0000 (22:30 +0100)]
Use sha256 instead of sha1 in release announcement
The last time perl got released, there was this comment:
https://www.nntp.perl.org/group/perl.perl5.porters/2022/01/msg262480.html
> Why use the old ( and somewhat broken ) SHA1 for message digests?
I decided to look into using SHA256;
I notice that the release managers guide gets the SHA1s from the PAUSE
email. So I've made a PR from PAUSE so that they no longer send SHA1s
(or MD5SUMS for that matter) but just SHA256. That change is live
already, see https://github.com/andk/pause/pull/379
So now the next step is to update the perl release documentation to deal
with the new reality that PAUSE mails no longer incluse sha1s!
Yves Orton [Sun, 23 Jan 2022 14:55:13 +0000 (15:55 +0100)]
Fixup Issue #19350 - Assert error under: use re Debug=>"ALL"
In
7c932d07cab18751bfc7515b4320436273a459e2 karl changed the regex
parser to not do two passes always, and instead do one if it could.
However in some edge cases it still must do a second past and some of
the info needed for the Debug => "All" would not be available during the
first pass.
This was compounded by S_add_data() validly returning a 0 index for data
that was stored in the data array, which meant that there was no way to
tell the difference between "we dont have the data to call S_add_data()
at all" and "we called S_add_data() and it returned 0", this in turn
would cause the dumping logic to try to access data that was not there,
and misinterpret it as a valid SV, with ensure assert fails or worse
segfaults.
This patch changes S_add_data() so it always returns a non-zero return,
so that the regex debug logic can tell that it shouldnt do a lookup into
the data array. This means create a new "what" type of "%", which is
used SOLELY to populate the ->data[0] and ->what[0] with a dummy entry.
With this done we can add guard statements to places that lookup things
in the data array, if the index is 0 it can not be valid.
Karl Williamson [Tue, 1 Feb 2022 00:17:33 +0000 (17:17 -0700)]
embed.fnc Fix function return type
Paul "LeoNerd" Evans [Mon, 31 Jan 2022 11:38:53 +0000 (11:38 +0000)]
Add @_ in signatured sub being experimental to perldelta.pod
Paul "LeoNerd" Evans [Wed, 19 Jan 2022 18:16:15 +0000 (18:16 +0000)]
Put some wording into perlsub.pod about @_ being discouraged in signatured subs
Paul "LeoNerd" Evans [Fri, 28 Jan 2022 17:42:21 +0000 (17:42 +0000)]
Emit experimental::snail_in_signatures warnings on uses of @_ (aka "snail") in signatured subs
Paul "LeoNerd" Evans [Fri, 28 Jan 2022 17:38:42 +0000 (17:38 +0000)]
Add a new 'experimental::snail_in_signatures' warning category
Paul "LeoNerd" Evans [Thu, 20 Jan 2022 19:50:47 +0000 (19:50 +0000)]
Set the CvSIGNATURE flag on signatured subs
Paul "LeoNerd" Evans [Mon, 6 Dec 2021 18:31:34 +0000 (18:31 +0000)]
Define a CvSIGNATURE flag
James E Keenan [Sun, 30 Jan 2022 14:18:07 +0000 (14:18 +0000)]
Synch in CPAN-2.33-TRIAL
For: https://github.com/Perl/perl5/issues/19358.
Used tarball from:
http://ftp.cpan.org/pub/CPAN/authors/id/A/AN/ANDK/CPAN-2.33-TRIAL.tar.gz
Tomasz Konojacki [Wed, 26 Jan 2022 23:55:21 +0000 (00:55 +0100)]
subroutine redefinitions made with local() shouldn't warn
The following code will no longer warn:
use warnings 'redefine';
sub foo {}
local *foo = sub{};
The main purpose of local() is to temporarily redefine stuff, so it
doesn't make sense to warn about it.
Paul "LeoNerd" Evans [Thu, 27 Jan 2022 11:29:42 +0000 (11:29 +0000)]
Also document and unit-test the correct handling of UTF-8
Paul "LeoNerd" Evans [Thu, 27 Jan 2022 00:54:53 +0000 (00:54 +0000)]
Add perldelta entry for the four new functions
Paul "LeoNerd" Evans [Thu, 27 Jan 2022 00:46:42 +0000 (00:46 +0000)]
Minor docs wording fixes
Paul "LeoNerd" Evans [Thu, 27 Jan 2022 00:33:51 +0000 (00:33 +0000)]
Clarify in docs that sv_eq* don't handle operator overloading; point to the sv_streq* funcs instead
Paul "LeoNerd" Evans [Thu, 27 Jan 2022 00:27:16 +0000 (00:27 +0000)]
Docs clarification that the basic sv_*eq() functions behave like the corresponding obvious perl code
Paul "LeoNerd" Evans [Thu, 27 Jan 2022 00:25:52 +0000 (00:25 +0000)]
Slight tidying of tests
Paul "LeoNerd" Evans [Thu, 27 Jan 2022 00:24:49 +0000 (00:24 +0000)]
Create sv_streq() API family, as a stringy copy of the sv_numeq() ones
Paul "LeoNerd" Evans [Tue, 14 Sep 2021 20:30:42 +0000 (21:30 +0100)]
Have sv_numeq() respect == overloading unless the SV_SKIP_OVERLOAD flag is passed
Paul "LeoNerd" Evans [Sun, 12 Sep 2021 15:03:12 +0000 (16:03 +0100)]
Initial implementation of sv_numeq() and _flags() variant
Dagfinn Ilmari Mannsåker [Sat, 22 Jan 2022 18:28:14 +0000 (18:28 +0000)]
Add test for experimental::builtin warnings
Dagfinn Ilmari Mannsåker [Sat, 22 Jan 2022 16:49:37 +0000 (16:49 +0000)]
Warn about experimental builtins at runtime as well as compile time
For when the functions are called via reference or perl4-style &foo syntax.
Paul "LeoNerd" Evans [Fri, 21 Jan 2022 18:37:38 +0000 (18:37 +0000)]
Fix bundled .pm files for experimental::builtin warnings
Paul "LeoNerd" Evans [Fri, 21 Jan 2022 18:39:15 +0000 (18:39 +0000)]
Fix lib/unicore/mktables for experimental::builtin warnings
Paul "LeoNerd" Evans [Fri, 21 Jan 2022 18:37:26 +0000 (18:37 +0000)]
Fix unit tests for experimental::builtin warnings
Paul "LeoNerd" Evans [Sat, 18 Dec 2021 22:35:51 +0000 (22:35 +0000)]
Emit experimental::builtin warnings from the builtin function callchecker
Paul "LeoNerd" Evans [Sat, 18 Dec 2021 22:03:20 +0000 (22:03 +0000)]
Add experimental::builtin warning
Paul "LeoNerd" Evans [Mon, 24 Jan 2022 13:48:57 +0000 (13:48 +0000)]
Remove remaining uses of @_ in signatured subs in lib/unicore/mktables
James Raspass [Sat, 22 Jan 2022 11:07:58 +0000 (11:07 +0000)]
Add ceil & floor to builtin
Karl Williamson [Sun, 23 Jan 2022 22:16:07 +0000 (15:16 -0700)]
regcomp.c: Fix undefined behavior
Spotted by ASAN. To shift 31 bits in a 32 bit word, it has to be
unsigned.
Karl Williamson [Sun, 23 Jan 2022 15:06:39 +0000 (08:06 -0700)]
perl.h: Add comments
James E Keenan [Fri, 21 Jan 2022 16:56:25 +0000 (16:56 +0000)]
Add '=cut' to silence POD formatting warning
Nicolas R [Thu, 20 Jan 2022 22:58:03 +0000 (16:58 -0600)]
Update epigraph for 5.35.8
Nicolas R [Thu, 20 Jan 2022 23:39:07 +0000 (17:39 -0600)]
Bumped Module-CoreList ready for 5.35.9
Nicolas R [Thu, 20 Jan 2022 23:16:58 +0000 (17:16 -0600)]
Bump B::OP_private version
Nicolas R [Thu, 20 Jan 2022 23:13:16 +0000 (17:13 -0600)]
Bump the perl version in various places for 5.35.9
Nicolas R [Thu, 20 Jan 2022 23:05:26 +0000 (17:05 -0600)]
New perldelta for 5.35.9
Nicolas R [Thu, 20 Jan 2022 22:59:13 +0000 (16:59 -0600)]
Tick off 5.35.8