This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
reneeb [Thu, 20 Feb 2020 23:47:55 +0000 (00:47 +0100)]
Merge branch 'release-5.31.9' into blead
Karl Williamson [Thu, 20 Feb 2020 17:44:55 +0000 (10:44 -0700)]
regcomp.c: Silence compiler warning
This parameter is unused except under certain debugging compile options
Spotted by James Keenan
reneeb [Thu, 20 Feb 2020 15:41:17 +0000 (16:41 +0100)]
.mailmap should be excluded from the MANIFEST cross checking during release
reneeb [Thu, 20 Feb 2020 15:35:26 +0000 (16:35 +0100)]
.mailmap should not be in MANIFEST, so exclude that file in Porting/manicheck
reneeb [Thu, 20 Feb 2020 14:47:36 +0000 (15:47 +0100)]
add new release to perlhist
reneeb [Thu, 20 Feb 2020 14:43:59 +0000 (15:43 +0100)]
finalize perldelta
reneeb [Thu, 20 Feb 2020 14:42:37 +0000 (15:42 +0100)]
Update Module::CoreList for 5.31.9
reneeb [Thu, 20 Feb 2020 13:51:36 +0000 (14:51 +0100)]
finalize perldelta
Karl Williamson [Sat, 4 Jan 2020 05:18:02 +0000 (22:18 -0700)]
Fixup POSIX::mbtowc, wctomb
This commit enhances these functions so that on threaded perls, they use
mbrtowc and wcrtomb when available, making them thread safe. The
substitution isn't completely transparent, as no effort is made to hide
any differences in errno setting upon error. And there may be slight
differences in edge case behavior on some platforms.
This commit also changes the behaviors so that they take a scalar
parameter instead of a char *, and this might be 'undef' or not be
forceable into a valid PV. If not a PV, the functions initialize the
shift state. Previously the shift state was always reinitialized with
every call, which meant these could not work on locales with shift
states.
In addition, there were several issues in mbtowc and wctomb that this
commit fixes.
mbtowc and wctomb, when used, are now run with a semaphore. This avoids
races if called at the same time in another thread.
The returned wide character from mbtowc() could well have been garbage.
The final parameter to mbtowc is now optional, as passing an SV allows
us to determine the length without the need for an extra parameter. It
is now used only to restrict the parsing of the string to shorter than
the actual length.
wctomb would segfault if the string parameter was shared or hadn't
been pre-allocated with a string of sufficient length to hold the
result.
Karl Williamson [Sat, 4 Jan 2020 05:10:43 +0000 (22:10 -0700)]
POSIX::mblen: Make length parameter optional
Now that the typemap is an SV, we can access the length from that.
Karl Williamson [Sat, 4 Jan 2020 05:16:42 +0000 (22:16 -0700)]
POSIX::mblen() Make thread-safe; allow shift state control
This commit changes the behavior so that it takes a scalar parameter
instead of a char *, and thus might not be forceable into a valid PV.
When not a PV, the shift state is reinitialized, like calling mblen with
a NULL first parameter. Previously the shift state was always
reinitialized with every call, which meant this could not work on
locales with shift states.
This commit also changes to use mbrlen() on threaded perls transparently
(mostly), when available, to achieve thread-safe operation. It is not
completely transparent because mbrlen (under the very rare stateful
locales) returns a different value when it's resetting the shift state.
It also may set errno differently upon errors, and no effort is made to
hide that difference. Also mbrlen on some platforms can handle partial
characters.
[perl #133928] showed that someone was having trouble with shift states.
Karl Williamson [Sun, 16 Feb 2020 00:39:00 +0000 (17:39 -0700)]
Restrict features in wildcards
The algorithm for dealing with Unicode property wildcards is to wrap the
user-supplied pattern with /miaa. We don't want the user to be able to
override the /m and /aa parts. Modifiers that are only specifiable as a
modifier in a qr or similar op (like /gc) can't be included in things
like (?gc). These normally incur a warning that they are ignored, but
the texts of those warnings are misleading when using wildcards, so I
chose to just make them illegal. Of course that could be changed to
having custom useful warning texts, but I didn't think it was worth it.
I also chose to forbid recursion of using nested \p{}, just from fear
that it might lead to issues down the road, and it really isn't useful
for this limited universe of strings to match against. Because
wildcards currently can't handle '}' inside them, only the single letter
\p,\P are valid anyway.
Similarly, I forbid the '*' quantifier to make it harder for the
constructed subpattern to take forever to make any progress and decide
to halt. Again, using it would be overkill on the universe of possible
match strings.
Karl Williamson [Thu, 13 Feb 2020 05:27:58 +0000 (22:27 -0700)]
regcomp.c: Reorder cases in a switch
This is for a future commit where one will have extra work to do before
falling through to the other.
Karl Williamson [Thu, 13 Feb 2020 04:07:27 +0000 (21:07 -0700)]
regcomp.c: Add wrappers for cmplng/xctng wildcard subpatterns
This is in preparation for being called from more than one place.
It has the salubrious effect that the wrapping we do around the user's
supplied pattern is no longer visible in the Debug output of that
pattern.
Karl Williamson [Thu, 13 Feb 2020 03:53:20 +0000 (20:53 -0700)]
regcomp.c: Create wrapper fcn for re_op_compile
This does the bulk of re_compile(), but is a private entry point,
meaning it takes an extra parameter, and a future commit will call it
from another place.
Karl Williamson [Wed, 12 Feb 2020 23:40:29 +0000 (16:40 -0700)]
op.h: Move some flag bits down
This is in preparation for adding a new flag bit at the end in a future
commit. It could have been added in the unused space that the first of
these was moved to, but the new one is less important/used, so I thought
it best to come last. The reason to use unused space is to preserve
binary compatibility with the bits, and we don't care about that at this
point in the development cycle.
Karl Williamson [Thu, 20 Feb 2020 04:36:33 +0000 (21:36 -0700)]
Regenerate charclass_invlists.h
There is something wrong with our mechanism to show if this out-of
-sync, because it didn't. And it needed regenerating. I will have to
look to understand the reason why. Nor did any of the tests fail. In
part, I see from looking at the diffs that there is a rule that is no
longer used. But it also may be that the Unicode-supplied test are
misisng things. Obviously one can't test every code point, but just a
representative sample, so some things may fall through the cracks.
Karl Williamson [Tue, 18 Feb 2020 17:51:26 +0000 (10:51 -0700)]
regcomp.c: Indent some nested # preprocessor directives
This is so you can figure out what the scope of the outer one is
Karl Williamson [Wed, 19 Feb 2020 16:47:16 +0000 (09:47 -0700)]
t/re/reg_mesg.t: Emit diagnostics on some more failing tests
Karl Williamson [Thu, 20 Feb 2020 00:07:20 +0000 (17:07 -0700)]
regcomp.c: Add missing save_re_context()
I noticed by symmetry that this call is missing. I don't think anyone
knows how to reliably reproduce the problem this causes under a race
with other threads.
Karl Williamson [Wed, 19 Feb 2020 18:06:23 +0000 (11:06 -0700)]
lib/charnames.t: Move initialization line
to a more intuitive spot in the file
Karl Williamson [Sat, 15 Feb 2020 18:15:09 +0000 (11:15 -0700)]
Move some obsolete UTF-8 handling fcns to mathoms
Two of the functions are internal to the core; the third has long been
deprecated.
Karl Williamson [Mon, 17 Feb 2020 17:59:35 +0000 (10:59 -0700)]
regcomp.c: White space only
This is mostly indenting and reflowing text after a surrounding block
was added by the previous commit.
Karl Williamson [Tue, 18 Feb 2020 02:25:04 +0000 (19:25 -0700)]
regcomp.c: Only output warning about experimental once
If someone uses an experimental construct, prior to this commit, they
would get a warning each time they used it in the same pattern. This
commit causes the warning to be emitted once per pattern.
I didn't add tests, because this I didn't think it important enough to
spend the time. The consequences of this breaking in the future are
minimal, and the constructs are temporary, likely to be removed next
release.
Karl Williamson [Mon, 17 Feb 2020 19:07:07 +0000 (12:07 -0700)]
Improve handling of nested qr/(?[...])/
A set operations expression can contain a previously-compiled one
interpolated in. Prior to this commit, some heuristics were employed
to verify it actually was such a thing, and not a sort of look-alike
that wasn't necessarily valid. The heuristics actually forbade legal
ones. I don't know of any illegal ones that were let through, but it is
certainly possible. Also, the error/warning messages referred to the
heuristics, and were unhelpful at best.
The technique used instead in this commit is to return a regop only used
by this feature for any nested compilations. This guarantees that the
caller can determine if the result is valid, and what that result is
without having to do any heuristics or inspecting any flags. The
error/warning messages are changed to reflect this, and I believe are
now helpful.
This fixes the bugs in #16779
https://github.com/Perl/perl5/issues/16779#issuecomment-
563987618
Karl Williamson [Mon, 17 Feb 2020 19:05:00 +0000 (12:05 -0700)]
regcomp.c: Fix comment
Karl Williamson [Mon, 17 Feb 2020 18:24:19 +0000 (11:24 -0700)]
regcomp.sym: Add new regnode type for (?[])
This new regnode is used to handle interpolated already-compiled regex
sets inside outer regex sets.
If it isn't present, it will mean that what appears to be a nested,
interpolated set really isn't.
I created a new regnode structure to hold a pointer. This has to be
temporary as pointers can be invalidated. I thought of just having a
regnode without a pointer as a marker, and using a parallel array to
store the data, rather than creating a whole new regnode structure for
just pointers, but parallel data structures can get out of sync, so this
seemed best.
This commit just sets up the regnode; a future commit will actually use
it.
Karl Williamson [Fri, 24 Jan 2020 18:11:02 +0000 (11:11 -0700)]
regcomp.c; ([?...]) are single char width
A regex set compiles to something that has width of exactly one
character. The change involved merely moving the setting of these flags
to before a return instead of after.
Karl Williamson [Wed, 19 Feb 2020 22:22:19 +0000 (15:22 -0700)]
Update to latest Unicode 13.0
Unicode has made minor changes in its data files since I added the beta
versions to Perl 5.31. These are still beta; the final release date is
March 10. I thought it best to get the latest into Perl 5.31.9.
Karl Williamson [Wed, 19 Feb 2020 21:55:50 +0000 (14:55 -0700)]
mktables: Handle versioning of non-UCD files
Unicode has lately been asking implementations to support non-Unicode
Character Database properties. Files for these contain a different
versioning syntax than the UCD files. Previously I was hand-editing
those files before commitiing to bring them to use a consistent style.
But that is tedious, and I decide to invest a little time to be able to
handle all the current versioning syntaxes automatically, to save having
to manually update in the future.
This was complicated by the fact that some Unicode non-UCD files have
BOM marks on many comment lines. I submitted a trouble report to them.
Dagfinn Ilmari Mannsåker [Sun, 16 Feb 2020 17:22:41 +0000 (17:22 +0000)]
Storable: linkify alternatives references
Also fix typo Serial → Sereal.
Dagfinn Ilmari Mannsåker [Tue, 21 Jan 2020 10:35:05 +0000 (10:35 +0000)]
Add 'indirect' feature that can be turned off to disable indirect object syntax
Co-authored-by: Tony Cook <tony@develop-help.com>
Karl Williamson [Sat, 15 Feb 2020 17:51:59 +0000 (10:51 -0700)]
perlreguts: Update
This makes changes, mainly in dealing with the removal of the sizing
pass in 5.30.
Patches welcome for other fixes.
Karl Williamson [Sat, 15 Feb 2020 04:54:43 +0000 (21:54 -0700)]
Update perlunicode base on Unicode UTS 18, regex reqs
Unicode is revising their document on what regular expression
implementations should do. This includes retraction of a significant
part of it, which Perl did not handle (and apparently nobody else
either). Thus we are much closer to implementing everything they say
than before. The document is adding some new (manageable) things, which
we do not yet support.
Hugo van der Sanden [Fri, 14 Feb 2020 13:08:21 +0000 (13:08 +0000)]
.mailmap: add old addresses for Hugo
Craig A. Berry [Thu, 13 Feb 2020 03:07:07 +0000 (21:07 -0600)]
Don't reopen open file in Tie-File/t/43_synopsis.t
Move the untie earlier and destroy the object holding the file
open. Otherwise the next test fails with "file currently locked by
another user" on OS's that open with exclusive locking.
Karl Williamson [Thu, 13 Feb 2020 15:58:10 +0000 (08:58 -0700)]
regen/regcomp.pl: Add cautionary comment
So the next person spends less time than I did in figuring things out
Karl Williamson [Thu, 13 Feb 2020 15:26:12 +0000 (08:26 -0700)]
perluniprops: Fix missing backslash
Karl Williamson [Thu, 13 Feb 2020 00:46:49 +0000 (17:46 -0700)]
regcomp.c: Move comment
This comment had gotten moved away from where it is applicable.
Steve Hay [Thu, 13 Feb 2020 08:01:50 +0000 (08:01 +0000)]
perlhist - Fix date of 5.31.0
Karl Williamson [Sat, 8 Feb 2020 04:30:45 +0000 (21:30 -0700)]
embed.fnc: Clarify comments
Karl Williamson [Wed, 5 Feb 2020 20:59:32 +0000 (13:59 -0700)]
lib/_charnames.pm: Fix typo in comment
Karl Williamson [Wed, 5 Feb 2020 20:32:26 +0000 (13:32 -0700)]
Add qr/\p{Name=...}/
This accomplishes the same thing as \N{...}, but only for regex
patterns, using loose matching and only the official Unicode names.
This commit includes a comparison of the two approaches, added to
perlunicode. But the real reason to do this is as a way station to
being able to specify wild card lookup on the name property, coming in a
later commit.
I chose to not include user-defined aliases nor :short character names
at this time. I thought that there might be unforeseen consequences of
using them. It's better to later relax a requirement than to try to
restrict it.
Karl Williamson [Wed, 5 Feb 2020 05:08:00 +0000 (22:08 -0700)]
regcomp.c: Convert boolean to an enum
This is in preparation for making this tri-valued instead of two.
Karl Williamson [Tue, 4 Feb 2020 21:43:14 +0000 (14:43 -0700)]
toke.c: Split code to load _charnames.pm into own fnc
This is in preparation for it being called from more than one place.
Karl Williamson [Tue, 4 Feb 2020 21:28:59 +0000 (14:28 -0700)]
toke.c: Change variable name, add one
This if for clarity as to what's going on, and to simplify some
expressions.
Karl Williamson [Fri, 31 Jan 2020 21:07:42 +0000 (14:07 -0700)]
toke.c: extract charnames code from S_new_constant
The code for dealing with charnames is intertwined and special cased in
S_new_constant. My guess is it was originally to offer customized,
better error messages when things go wrong. Much later the function was
changed so that a message could be returned instead of output, and the
code didn't really need the customization any longer. But by then
autoloading of charnames had been added when a \N[} was parsed, meaning
that more special casing was added instead, as that had been the logical
place to do it.
This commit extracts the special charnames handling to the one place it
is actually used, and the disentangled S_new_constant is then called.
This is in preparation for future commits, and makes the code cleaner.
This adds testing of the new syntax to lib/charnames.t. That file
randomly generates some tests, simply because there are too many names
to test reasonably at once. To compensate for the added tests, I
lowered the percentage per run of characters tested so that this file
takes about the same amount of time as before.
Karl Williamson [Wed, 12 Feb 2020 20:27:45 +0000 (13:27 -0700)]
lib/charnames.t: Add a couple of tests
These are problematic character names; test them always
Karl Williamson [Wed, 12 Feb 2020 22:02:46 +0000 (15:02 -0700)]
Remove claimed support for mbstowcs, wcstombc
As noted in perldelta, these functions could not have ever worked, and
there is no demand for them, hence no reason to make them work.
This fixes GH #17388
Dagfinn Ilmari Mannsåker [Wed, 12 Feb 2020 20:18:40 +0000 (20:18 +0000)]
Revert "pp_(get|set)priority: remove ancient glibc C++ workaround"
It turns out that even though the headers correctly define the argument
as `int` under C++, -Wc++-compat doesn't know this.
Add a comment to stop others from falling into the same trap I did.
This reverts commit
34d254cefc451e5ab438acf22a51d7b557c05a0e.
Karl Williamson [Tue, 11 Feb 2020 04:49:01 +0000 (21:49 -0700)]
perlreref: quantifier {,n} is now illegal
And has been for a while. Update the pod.
James E Keenan [Tue, 11 Feb 2020 13:29:29 +0000 (13:29 +0000)]
Additional email (github) address for Richard Leach
Correct two earlier formatting errors.
Richard Leach [Fri, 7 Feb 2020 22:01:25 +0000 (22:01 +0000)]
Tie::File - Document use of binmode on filehandles
Documentation fix for #17497, where the user passed a filehandle in, but the lack of binmode meant that the :crlf layer on Windows caused problems when the file was later used on Linux.
Todd Rinaldo [Fri, 31 Jan 2020 05:02:51 +0000 (23:02 -0600)]
Make Tie::File distro conform to strict and warnings.
Fixes #17495
Todd Rinaldo [Mon, 3 Feb 2020 17:34:14 +0000 (11:34 -0600)]
Remove %newkeys from Tie::File::_oadjust
Recent efforts to add strict have shown this variable
wasn't even being used.
Todd Rinaldo [Fri, 31 Jan 2020 05:02:16 +0000 (23:02 -0600)]
Sync Tie-File changelog with CPAN
Marc Green [Tue, 14 Feb 2012 01:04:37 +0000 (20:04 -0500)]
Reword pod2html crossref err msgs; show only if $verbose
Fixes #11860
Karen Etheridge [Mon, 10 Feb 2020 19:52:59 +0000 (11:52 -0800)]
add missing RT links to older perldelta
Karen Etheridge [Mon, 10 Feb 2020 19:48:07 +0000 (11:48 -0800)]
improve pod formatting and minor punctuation nit
Yves Orton [Mon, 10 Feb 2020 09:17:15 +0000 (10:17 +0100)]
t/porting/manifest.t: ignore .mailmap
.mailmap is used by git to map emails in commit logs to their
correct form. When I added it in
a04d7ffe7d4cd836bf5246ea6050612f01403a96
I checked MANIFEST for .gitignore, which I did not find, and assumed
that dotfiles were exempt from MANIFEST requirements. Similarly I
assumed there was nothing to test. Bad Yves.
This updates the test to ignore .mailmap in MANIFEST checks.
Yves Orton [Mon, 10 Feb 2020 08:37:39 +0000 (09:37 +0100)]
.mailmap: add a file to allow git to show correct emails
the .mailmap file allows git to correct committer details in things like
git log. Compare `git log --author=yves` with `git log --use-mailmap --author=yves`
the former finds commits I have made using old email addresses, the latter
finds nothing as the corrected version of my name is "Yves Orton". Conversly
`git log --use-mailmap --author=Yves` will find pretty much *all* of my commits.
Yves Orton [Thu, 6 Feb 2020 07:40:57 +0000 (08:40 +0100)]
toke.c - handle ${10} properly - Issue #12948
${10} and $10 were handled differently, this patch makes them be handled
the same. It also forbids multi-digit numeric variables from starting
with 0. Thus $00 is now a new fatal exception
"Numeric variables with more than one digit may not start with '0'"
Tony Cook [Thu, 6 Feb 2020 13:08:24 +0000 (08:08 -0500)]
Document purpose of miniperl
For: https://github.com/Perl/perl5/issues/16158
(formerly RT 132137).
Hugo van der Sanden [Sun, 9 Feb 2020 16:46:15 +0000 (16:46 +0000)]
skip op/signame_canonical test under miniperl
It requires Data::Dumper
Yves Orton [Sat, 8 Feb 2020 15:02:49 +0000 (16:02 +0100)]
perl.h: define PERL_BITFIELD8/16/32 as U8/U16/U32
After consultation with xenu we decided that defining both sets exactly the same
as U8/U16/U32 makes the most sense.
These defines were added in
654eccd594bfe8deab367b0f4cdda726a7796ff3 and the discussion
for why is here: https://www.nntp.perl.org/group/perl.perl5.porters/2008/01/msg133754.html
Short summary: Activestate added these defines so that XS code compiled with gcc on windows
could be used with a perl compiled with VC on windows, and vice-versa. Read the thread
for more details.
This patch does NOT remove the duplicate definition in win32/win32.h, I
don't feel comfortable doing that without being able to check the build,
so I will leave it to someone who has VC to test.
Yves Orton [Sat, 8 Feb 2020 14:14:38 +0000 (15:14 +0100)]
pp_sys.c: add casts to silence Win32 build warnings
Yves Orton [Sat, 8 Feb 2020 12:06:07 +0000 (13:06 +0100)]
regcomp.c: silence possible loss of data warnings
added casts, and asserts to verify that we arent losing data
..\regcomp.c(3589) : warning C4244: '=' : conversion from 'U32' to 'U8', possible loss of data
..\regcomp.c(3603) : warning C4244: '=' : conversion from 'U32' to 'U16', possible loss of data
..\regcomp.c(4192) : warning C4244: '=' : conversion from 'unsigned long' to 'U8', possible loss of data
..\regcomp.c(14900) : warning C4244: '=' : conversion from 'UV' to 'char', possible loss of data
..\regcomp.c(14918) : warning C4244: '=' : conversion from 'UV' to 'char', possible loss of data
..\regcomp.c(17621) : warning C4244: 'function' : conversion from 'IV' to 'const char', possible loss of data
..\regcomp.c(17643) : warning C4244: 'function' : conversion from 'IV' to 'const char', possible loss of data
Yves Orton [Sat, 8 Feb 2020 10:58:32 +0000 (11:58 +0100)]
Revert "Update Scalar-List-Utils to CPAN version 1.54"
This reverts commit
16933d619ff0a6284a4a90626ab5d39e472c694f.
This breaks Win32 builds as it does not include trunc(),
which is causing havoc with our build process. See issue #17550
Yves Orton [Sat, 8 Feb 2020 10:02:08 +0000 (11:02 +0100)]
fix defines for PERL_BITFIELDxx on Linux and Win32
for some reason PERL_BITFIELD32 is defined as "unsigned" which is
defined to be the same as "unsigned int" which could be 16 bits.
This changes the definition for PERL_BITFIELDxx to be the same
on both platforms and to use the full names for the type, and to
use a type which is guaranteed to be at least 32 bits long for
PERL_BITFIELD32.
Chris 'BinGOs' Williams [Fri, 7 Feb 2020 11:06:59 +0000 (11:06 +0000)]
Update Scalar-List-Utils to CPAN version 1.54
[DELTA]
1.54 -- 2020-02-02 15:47
[CHANGES]
* Added List::Util::reductions (RT128237)
* Added List::Util::sample (RT131535)
* Recognise $List::Util::RAND as a source of randomness for sampling
functions (RT131536)
[BUGFIXES]
* Document the difference between ref() and reftype() on precompiled
qr// regexps (RT127963)
* Various improvements to List::Util::uniqnum() to handle stringified
Inf and NaN, negative zero
* Detect platform NV size and number of digits required to calculate
uniqueness
Chris 'BinGOs' Williams [Fri, 7 Feb 2020 10:24:04 +0000 (10:24 +0000)]
Tie-File is 1.05 on CPAN
Chris 'BinGOs' Williams [Fri, 7 Feb 2020 10:21:48 +0000 (10:21 +0000)]
Update parent to CPAN version 0.238
[DELTA]
0.238 2020-02-07
. Move the prerequisite Test::More from being a runtime prerequisite
to a test time / build time prerequisite (PR #11, by Haarg)
Chris 'BinGOs' Williams [Fri, 7 Feb 2020 10:19:44 +0000 (10:19 +0000)]
Update Devel-PPPort to CPAN version 3.57
[DELTA]
3.57 - 2020-01-31
* Fix eval_sv for Perl versions prior to 5.6.0 (Pali)
* Fix t/ppphtest.t for Perl versions prior to 5.6.0 (Pali)
* Fix compilation of sv_setsv_flags when GCC extensions are not present (Pali)
* Fix SV_NOSTEAL on 5.7.2 (Karl Williamson)
* Fix multiple unit test issues (Craig A. Berry, Karl Williamson, Pali)
* Avoid generating warnings on early Perls (Karl Williamson)
* Backport memCHRs (Karl Williamson)
* Implement sv_setsv_flags() with SV_NOSTEAL and SV_GMAGIC flags for Perl versions < 5.7.3 (Pali)
* Implement UTF8f format and its UTF8fARG macro (Pali)
Chris 'BinGOs' Williams [Fri, 7 Feb 2020 10:12:36 +0000 (10:12 +0000)]
Update Archive-Tar to CPAN version 2.36
[DELTA]
2.36 02/02/2020
- Add xz test files to MANIFEST
2.34 01/02/2020 (HEANEY && SKAJI)
- Add xz support
- Use 4 digit year in Time::Local call
Yves Orton [Fri, 7 Feb 2020 07:31:49 +0000 (08:31 +0100)]
regcomp.c: make \K+ and \K* illegal.
Karl Williamson [Wed, 5 Feb 2020 20:22:30 +0000 (13:22 -0700)]
perlunicode: Slight clarification
Karl Williamson [Wed, 5 Feb 2020 20:20:56 +0000 (13:20 -0700)]
pod/perlrecharclass.pod: Slight clarification
James E Keenan [Wed, 5 Feb 2020 20:42:35 +0000 (15:42 -0500)]
Additional email for E Choroba
Keep Porting/checkAUTHORS.pl happy.
E. Choroba [Wed, 5 Feb 2020 13:26:27 +0000 (14:26 +0100)]
Add a missing switch to a documentation example
The switch is mentioned in the next paragraph.
It was removed in
428bacd701ef45155f9dfd0d9c3d063dc305de00, probably
by accident (the commit message isn't much informative).
Dagfinn Ilmari Mannsåker [Tue, 4 Feb 2020 15:51:11 +0000 (15:51 +0000)]
regen/opcdode.pl: remove alternate PP function implementation support
This was only used for working around a bug in glibc < 2.3, which was
removed in the previous commit.
Dagfinn Ilmari Mannsåker [Tue, 4 Feb 2020 15:46:13 +0000 (15:46 +0000)]
pp_i_modulo(): remove workaround for ancient glibc bug
Old glibc versions had a buggy modulo implementation for 64 bit
integers on 32-bit architectures. This was fixed in glibc 2.3,
released in 2002 (the version check in the code is overly cautious).
Removing the alternate PP function support is left for the next
commit, in case we need to resurrect it in future.
Todd Rinaldo [Fri, 31 Jan 2020 07:11:37 +0000 (01:11 -0600)]
Make it possible to remove a closed IO::Socket handle from IO::Select.
Fixes #17447
Todd Rinaldo [Thu, 30 Jan 2020 17:53:31 +0000 (11:53 -0600)]
Pass the canonical signal name to the signal handler when it is invoked.
Prior to this change, when a signal handler was invoked, the signame passed
into the sub would be the name of the signal that was defined first via {}.
This meant that the handler had to either be aware of the duplicates and
handle things appropriately or it would be at the mercy of action at a
distance the handler might be unaware of.
This change assures a consistent signal name for now on. It should be
the first signal listed in $Config{sig_name}. Duplicates are listed
at the end.
Dagfinn Ilmari Mannsåker [Tue, 4 Feb 2020 15:24:54 +0000 (15:24 +0000)]
pp_(get|set)priority: remove ancient glibc C++ workaround
Glibc has enum typedefs for some arguments that are defined as `int`
by the X/Open standard. This is fine in C, but until glibc
2.3 (released in 2002) this was also done for C++, which is not
allowed.
James E Keenan [Fri, 31 Jan 2020 03:23:18 +0000 (03:23 +0000)]
Do not ignore non-zero error code from 'make minitest'
In pipelines like:
$ sh ./Configure -des -Dusedevel && \
make minitest && make test_harness
... we don't want to run 'make test_harness' unless 'make minitest' has
succeeded.
To test:
$ echo "exit(1);" >> t/base/cond.t
$ make minitest && echo "hello world"
# [note that minitest fails quickly and 'echo' is not reached]
$ git checkout -- t/base/cond.t
$ make minitest && echo "hello world"
# [note that minitest runs and 'echo' is reached]
For: https://github.com/perl/perl5/issues/16160
Originally: https://rt-archive.perl.org/perl5/Ticket/Display.html?id=132139
James E Keenan [Mon, 3 Feb 2020 21:33:19 +0000 (16:33 -0500)]
Prohibit usage of Test::Simple under 't/'
One of the objectives of t/porting/bootstrap.t has been to prohibit use of
testing modules which need to be loaded via 'use MODULE' in test files found
in subdirectories under 't/'. In those subdirectories, we do not presume that
module loading via 'use MODULE' has been demonstrated to work. However, the
unit test in bootstrap.t was written solely to spot instances of 'use
Test::More'. It did not consider the possibility that a test file under 't/'
might 'use Test::Simple'.
There was one such test file which use-d Test::Simple:
t/lib/overload_nomethod.t. This patch rewrites that file to use 't/test.pl'
(as other t/lib/*.t files customarily do) and adapts t/porting/bootstrap.t to
rule out 'use Test::Simple' as well as 'use Test::More' from '*.t' files
underneath 't/'.
For: https://github.com/Perl/perl5/issues/13231
James E Keenan [Mon, 3 Feb 2020 20:44:50 +0000 (15:44 -0500)]
Clarify guidance for usage of Test::More in tests
As reported by Smylers in RT 119619 (now GH 13231), the guidance
provided in 'perlhack' for usage of Test::More is misleading. In
practice, we do not use Test::More in test files in the
subdirectories underneath 't/'. In these directories we test
Perl 5's "pre-modular" functionality -- functionality which does not
depend on our having demonstrated that we can load code via 'use
MODULE'. Usage of 'use MODULE' in 't/*/*.t' files has been largely
prohibited by a unit test in t/porting/bootstrap.t.
This patch clarifies that guidance.
POD correction per Tony Cook
For: https://github.com/Perl/perl5/issues/13231
David Mitchell [Tue, 4 Feb 2020 12:23:26 +0000 (12:23 +0000)]
multiconcat: keep assign for 'local $foo = "..."'
In something like
local $~ = "$~X";
i.e. where localising a magic variable whose previous value should be
used as part of a string concat on the RHS, don't fold the assign into
the multiconcat op. Otherwise the code execution path looks a bit like:
local($~) = undef;
multiconcat($~, $~, "X");
[ where multiconcat's args are (target, arg1, arg2,....) ]
and thus multiconcat sees an undef arg.
By leaving the assign out of the multiconcat, code execution now looks
like
my $targ;
multiconcat($targ, $~, "X");
local($~) = $targ;
See http://nntp.perl.org/group/perl.perl5.porters/256898,
"Bug in format introduced in 5.27.6".
Although the bug only appears with magic vars, this patch pessimises
all forms of 'local $foo = "..."', 'local $foo{bar} = "..."' etc.
Strictly speaking the bug occurs because with 'local' you end up with
two SVs (the saved one and the one currently in the glob) which both
have the same container magic and where mg_set()ing one changes the
mg_get() value of the other. Thus, vars like $!. One of the two SVs
becomes an arg of multiconcat, the other becomes its target. Part of
localising the target SV (before multiconcat is called) wipes the value
of the arg SV.
Yves Orton [Sun, 2 Feb 2020 13:15:18 +0000 (14:15 +0100)]
pp_sort.c: Tinker with pp_sort to untickle mingw bug
David Mitchell [Mon, 3 Feb 2020 14:44:55 +0000 (14:44 +0000)]
pp_crypt(): reindent CPP directives
They were all over the place.
Whitespace-only.
Yves Orton [Tue, 4 Feb 2020 08:02:47 +0000 (09:02 +0100)]
B::perlstring - add support for \e (Fix #17526)
In
daf6caf1ef25ff48f871fa1e53adcefc11bf1d08 karl made pv_uni_display()
use the available mnemonic escapes instead of using \x{} style escapes.
This broke B::perlstring() which has an exclusion list of such escapes
to passthrough, and it did not know about \e, so it produced "\\e"
instead of "\e", which of course does not round trip.
This in turn broke Sub::Quote, which in turn breaks Moo, which breaks
a lot of stuff. :-)
Unfortunately B::perlstring() had no tests to detect this, so we only
found out when we got a BBC report that happened to also ticklet this
bug.
This patch adds 'e' to the exclusion list, and also adds tests to see
that the the first 1024 unicode codepoints and all 255 non-unicode
codepoints can round trip through B::perlstring().
This should resolve #17526 and indirectly help us close #17245.
With this patch we bump B.pm to v1.80
Karl Williamson [Mon, 3 Feb 2020 23:20:03 +0000 (16:20 -0700)]
Support Unicode properties Identifier_(Status|Type)
These non-UCD properties are now being asked to be supported by the
Unicode regular expression specification, UTS #18
These have a slightly different header syntax for giving the version
than UCD files. In this commit, I modify these to fit, but will
probably have to generalize at some point the parsing of versions in
mktables.
Karl Williamson [Mon, 3 Feb 2020 23:19:26 +0000 (16:19 -0700)]
Add Unicode UTS #39 files
The Unicode regular expression specification, UTS #18 is being revised
to require properties that aren't part of the strict Unicode character
database. This commit adds the first two that are being asked for.
Karl Williamson [Mon, 3 Feb 2020 21:49:44 +0000 (14:49 -0700)]
mktables: Generalize the scx property handling
Until now, this property was unique in that it specifies a set of
possible values for scripts that a character can be in, rather than a
single script. That multiplicity has been handled specially. But the
next couple of commits will introduce another property that has similar
characteristics. This commit makes the scx handling more general, so as
to also be usable for the new property.
Karl Williamson [Mon, 3 Feb 2020 21:01:56 +0000 (14:01 -0700)]
mktables: Improve warning msg
Karl Williamson [Mon, 3 Feb 2020 20:44:44 +0000 (13:44 -0700)]
mktables: Add capability to override match directory
This is because this is still supposed to work on DOS 8.3 filesystems,
and future commits will use non-Unicode-Character-Database tables which
don't have shorter names.
David Mitchell [Mon, 3 Feb 2020 12:37:15 +0000 (12:37 +0000)]
pp_crypt(): remove ancient glibc bug workaround
GH #16552
In 2003 a fix was added to workaround a bug in glibc's crypt_r()
implementation (which involved tweaking a private undocumented field
within the crypt_data struct). This bug has long since been fixed, but
the workaround remained. This commit finally removes that workaround.
See also v5.27.11-33-ge9c9cf5759.
David Mitchell [Mon, 3 Feb 2020 12:15:54 +0000 (12:15 +0000)]
Tie::File: use unique tmp filename in 29a_upcopy.t
This is a followup to v5.31.7-92-g0a1552bada which made each Tie::File
test script use a separate prefix for its test file names. However,
there are two test files with prefixes 29_ and 29a_, and that commit
made them both use "29" for the temp file. Make it "29a" instead.
Yves Orton [Fri, 31 Jan 2020 14:02:46 +0000 (15:02 +0100)]
toke.c: fix Multidimensional array heuristic to ignore function calls
Fix issue #16535 - $t[index $x, $y] should not throw Multidimensional
array warnings.
The heuristic for detecting lists in array subscripts is implemented
in toke.c, which means it is not particularly reliable. There are
lots of ways that code might return a list in an array subscript.
So for instance $t[do{ $x, $y }] should throw a warning but doesn't.
On the other hand, we can make this warning less likely to happen
by being a touch more careful about how we parse the inside of the
square brackets so we do not throw an exception from $t[index $x,$y].
Really this should be moved to the parser so we do not need to rely
on fallable heuristics, and also into the runtime so that if we have
$t[f()]
and f() returns a list we can also warn there. But for now this
improves things somewhat.
Hugo van der Sanden [Sat, 1 Feb 2020 12:20:42 +0000 (12:20 +0000)]
op.c: hoist first-pass logic out of loop in pmtrans()
Mainly to avoid gcc warnings that found the logic too complex to follow.