This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Karl Williamson [Sun, 4 Mar 2018 01:52:07 +0000 (18:52 -0700)]
locale.c: Remove redundant SAVE_ERRNO
The errnos were already saved just above
Karl Williamson [Sun, 4 Mar 2018 00:27:48 +0000 (17:27 -0700)]
perlguts: Clarify an example.
Karl Williamson [Fri, 2 Mar 2018 19:13:55 +0000 (12:13 -0700)]
Reword warning for deviations from UTF-8 locales
Some locales are UTF-8, but not exactly what Perl is expecting. Revise
the message raised in this circumstance.
Originally I thought these were violations of Unicode, but based on
feedback from Craig Berry, I came to realize that these are legitimate
interpretations of the Unicode standard. But perl persists with its own
interpretation that differs from these, hence the warning.
Karl Williamson [Fri, 2 Mar 2018 19:30:09 +0000 (12:30 -0700)]
Bump version of POSIX.pm to 1.83; warnings to 1.42
These were made using the old version number, and the error was not
caught, because of the lateness in getting 5.27.9 tagged
Father Chrysostomos [Fri, 2 Mar 2018 18:52:45 +0000 (10:52 -0800)]
perldelta typo
Father Chrysostomos [Fri, 2 Mar 2018 18:50:55 +0000 (10:50 -0800)]
perldelta for Carp changes since 5.27.9
Most of the commits that modified Carp.pm were either minor fix-ups
for previous commits or fixes for bugs introduced by previous commits.
Hence, there are validly only three entries, even though it seems
a small number for such a flurry of activity.
All significant Carp changes prior to this commit are accounted for.
Father Chrysostomos [Fri, 2 Mar 2018 18:30:51 +0000 (10:30 -0800)]
Remove 5.27.9 entries from 5.27.10’s delta
Sawyer X [Fri, 2 Mar 2018 18:11:13 +0000 (20:11 +0200)]
regen
Sawyer X [Fri, 2 Mar 2018 18:11:08 +0000 (20:11 +0200)]
Bump Module::CoreList
reneeb [Tue, 20 Feb 2018 21:41:22 +0000 (22:41 +0100)]
Bump version
reneeb [Tue, 20 Feb 2018 21:31:17 +0000 (22:31 +0100)]
New Perldelta
reneeb [Tue, 20 Feb 2018 21:24:23 +0000 (22:24 +0100)]
Tick release in release schedule
reneeb [Tue, 20 Feb 2018 21:23:18 +0000 (22:23 +0100)]
Update epigraph.pod
Karl Williamson [Fri, 2 Mar 2018 15:04:00 +0000 (08:04 -0700)]
mg.c: Fix isSCRIPT_RUN call
Commit
49cd072660b3b1858be5f27df107b3b42498a3f3 failed to fix up this
call to isSCRIPT_RUN, which is typically only compiled on Windows.
David Mitchell [Fri, 2 Mar 2018 13:37:45 +0000 (13:37 +0000)]
[MERGE] fixups for attributes-before-signatures
RT #132760
v5.27.7-212-g894f226 recently moved subroutine attributes from after
the signature to before the signature.
This small branch performs some minor tweaks to that; principally:
* splits the parser rules for subs into separate rules for subs
within and without the scope of 'use feature "signatures";
* makes the parser and toker recognise the possibility of attributes
following the signature, so that a targeted error message can be given,
rather than a general 'syntax error' and follow-on dross.
David Mitchell [Mon, 26 Feb 2018 18:52:23 +0000 (18:52 +0000)]
detect sub attributes following a signature
RT #132760
A recent commit (v5.27.7-212-g894f226) moved subroutine attributes back
before the subroutine's signature: e.g.
sub foo :prototype($$) ($a, $b) { ... } # 5.18 and 5.28 +
sub foo ($a, $b) :prototype($$) { ... } # 5.20 .. 5.26
This change means that any code still using an attribute following the
signature is going to trigger a syntax error. However, the error, followed
by error recovery and further warnings and errors, is very unfriendly and
gives no indication of the root cause. This commit introduces a new error,
"Subroutine attributes must come before the signature".
For example, List::Lazy, the subject of the ticket, failed to compile
tests, with output like:
Array found where operator expected at blib/lib/List/Lazy.pm line 43,
near "$$@)" (Missing operator before @)?)
"my" variable $step masks earlier declaration in same statement at
blib/lib/List/Lazy.pm line 44.
syntax error at blib/lib/List/Lazy.pm line 36, near ") :"
Global symbol "$generator" requires explicit package name (did you
forget to declare "my $generator"?) at blib/lib/List/Lazy.pm line 38.
Global symbol "$state" requires explicit package name (did you forget
to declare "my $state"?) at blib/lib/List/Lazy.pm line 39.
Global symbol "$min" requires explicit package name (did you forget to
declare "my $min"?) at blib/lib/List/Lazy.pm line 43.
Global symbol "$max" requires explicit package name (did you forget to
declare "my $max"?) at blib/lib/List/Lazy.pm line 43.
Global symbol "$step" requires explicit package name (did you forget
to declare "my $step"?) at blib/lib/List/Lazy.pm line 43.
Invalid separator character '{' in attribute list at
blib/lib/List/Lazy.pm line 44, near "$step : sub "
Global symbol "$step" requires explicit package name (did you forget
to declare "my $step"?) at blib/lib/List/Lazy.pm line 44.
But following this commit, it now just outputs:
Subroutine attributes must come before the signature at
blib/lib/List/Lazy.pm line 36.
Compilation failed in require at t/append.t line 5.
BEGIN failed--compilation aborted at t/append.t line 5.
It works by:
1) adding a boolean flag (sig_seen) to the parser state to indicate that a
signature has been parsed;
2) at the end of parsing a signature, PL_expect is set to XATTRBLOCK
rather than XBLOCK.
Then if something looking like one or more attributes is encountered
by the lexer immediately afterwards, it scans it as if it were an
attribute, but then if sig_seen is true, it croaks.
David Mitchell [Mon, 26 Feb 2018 13:50:50 +0000 (13:50 +0000)]
subtly change meaning of XATTRBLOCK, XATTRTERM
Currently they tell the toker that the next thing will be attributes,
followed by an XBLOCK or XTERMBLOCK respectively.
This commit subtly changes their meanings so that they indicate that
attributes legally *might* follow. This makes the code which initially
sets them slightly simpler (no need to check whether the next char is
':'), and the code elsewhere in yylex() which handles XATTR* only triggers
if the next char is ':' anyway.
Doing it this way will shortly make detection simpler of an attribute
illegally following a signature.
David Mitchell [Thu, 22 Feb 2018 14:44:51 +0000 (14:44 +0000)]
rationalise subroutine parsing rules
Now that the parser rules have been split into separate rules for subs
under 'use feature "signatures"' and not, refine the rules to reflect the
different regimes. In particular:
1) no longer include 'proto' in the signature variants: as it happens the
toker would never return a proto THING under signatures anyway, but
removing it from the grammar makes it clearer what's expected and not
expected.
2) Remove 'subsignature' from non-sig rules: what used to happen before
was that outside of 'use feature "signatures"', it might still try to
parse a signature, e.g.
$ perl5279 -we 'sub f :lvalue ($$@) { $x = 1 }'
Illegal character following sigil in a subroutine signature at -e line
1, near "($"
syntax error at -e line 1, near "$$@"
Now it's just a plain syntax error.
David Mitchell [Thu, 22 Feb 2018 12:23:52 +0000 (12:23 +0000)]
parse subs and signature subs separately
Currently the toker returns a SUB or ANONSUB token at the beginning
of a sub (or BEGIN etc). Change it so that in the scope of
'use feature "signatures"', it returns a SIGSUB / ANON_SIGSUB token
instead.
Then in perly.y, duplicate the 2 rules containing SUB / ANONSUB
to cope with these two new tokens.
The net effect of this is to use different rules in the parser for
parsing subs when signatures are in scope.
Since the two sets of rules have just been cut and pasted, there should
be no functional changes yet, but that will change shortly.
David Mitchell [Thu, 22 Feb 2018 12:11:26 +0000 (12:11 +0000)]
add Perl_init_named_cv() functiom
This moves a block of code out from perly.y into its own function,
because it will shortly be needed in more than one place.
Should be no functional changes.
Sawyer X [Fri, 2 Mar 2018 12:55:14 +0000 (14:55 +0200)]
Merge remote-tracking branch 'renee/release-5.27.9' into blead
Karl Williamson [Fri, 2 Mar 2018 02:30:42 +0000 (19:30 -0700)]
perl.h: Add comment about clang warnings
Commit
b2f82b52000c3bfe6e6df200c775e2a639d91552 failed to document
details about the clang warnings. This commit adds a link to clang's
documentation
Karl Williamson [Fri, 2 Mar 2018 02:11:43 +0000 (19:11 -0700)]
Remove parameter from isSCRIPT_RUN
Daniel Dragan pointed out that this parameter is unused (the commits
that want it didn't get into 5.28), and is causing a table to be
duplicated all over the place, so just remove it for now.
Karl Williamson [Mon, 26 Feb 2018 04:38:21 +0000 (21:38 -0700)]
Silence wrong clang warnings
Clang thread-safety analysis fails to correctly work in this situation
(and is documented as failing), so turn off that warning here.
Karl Williamson [Fri, 2 Mar 2018 01:09:42 +0000 (18:09 -0700)]
numeric.c: Refactor code to use only one RESTORE
This code saves and restores the LC_NUMERIC locale. This commit
refactors it so that only one RESTORE is done. The reason is because
having two, depending on various data confuses clang's static analysis
of thread safety, leading to false positive scary warnings.
Daniel Dragan [Thu, 1 Mar 2018 00:42:19 +0000 (19:42 -0500)]
regen/regcomp.pl: close FH before unlink
On Win32, regen.pl failed if something caused different checksum for
perldebguts.pod and the old file was attempted to be unlinked/renamed, but
that was failing because the FH is still open (Win32 specific thing).
So close the FH before renaming the file instead of having scope exit close
the FH after close_and_rename() executes.
the fixed error console log:
changed 'pod/perldebguts.pod-new' to 'pod/perldebguts.pod'
Couldn't unlink pod/perldebguts.pod: Permission denied
renaming pod/perldebguts.pod-new to pod/perldebguts.pod: Permission denied at ./
regen/regen_lib.pl line 120, <$oldguts> line 1046.
Changed: pod/perldebguts.pod
C:\perl\bin\perl.exe -I. regen/regcomp.pl -v failed: 3328 at regen.pl line 20, <
DATA> line 8.
Daniel Dragan [Sun, 18 Feb 2018 07:57:39 +0000 (02:57 -0500)]
remove unused var in sv_eq_flags
svrecode became unused in commit
8df0e7a28b
"Remove IN_ENCODING macro, and all code dependent on it" but there was
still a SvREFCNT_dec(NULL) executed at the end of the function. This
commit will reduce size of Perl_sv_eq_flags by the CC not having to
save var eq to a non-volatile register or stack location around the
SvREFCNT_dec func call and instead store var eq in the return register
directly. Also remove the eq var completly, since initializing the var
so early means it has to be stored on the stack around alot func calls,
so just do a direct return of const zero on the only "fall off the end"
path in the func.
Tony Cook [Wed, 28 Feb 2018 05:43:07 +0000 (16:43 +1100)]
(perl #132893) don't probe for Storable recursion limits on old Win32
Steve Hay [Wed, 28 Feb 2018 21:25:04 +0000 (21:25 +0000)]
We hope to release 5.26.2 and 5.24.4 together in March
Yves Orton [Wed, 28 Feb 2018 15:02:17 +0000 (16:02 +0100)]
rework Carp/t/stack_after_err.t to not use perl -e
Father Chrysostomos [Tue, 27 Feb 2018 19:24:09 +0000 (11:24 -0800)]
Carp: Speed up longmess some more
Commit
915a6810d added a UNIVERSAL::isa check to format_arg (used by
longmess, which generates stack traces) to see whether an argument is
blessed before trying CARP_TRACE, to speed things up when the argu-
ment is not blessed.
Because this would cause infinite recursion when the UNIVERSAL::isa
module is loaded, a check was put in place to avoid this problem. But
the check was a run-time check, and so the speed-up was minimal.
If we move the check to compile time (and save the original
&UNIVERSAL::isa in case the module gets loaded later), then the speed-
up is signifant. That is what this patch does.
Before this patch, the following one-liner runs on my machine in 6
seconds on average:
$ ./perl -MCarp -Ilib -e 'sub f { my $c = shift; if ($c == 100) { Carp::longmess() } else { f($c+1,{}) } } f(0,{}) for 1..500'
If I disable the isa check (just to see how much it was speeding
things up), it averages 6.5 seconds, not much of a difference.
If I move the $UNIVERSAL::isa::VERSION safety check to compile time
instead of run time, I can reduce the time to 4.9 seconds.
Karl Williamson [Tue, 27 Feb 2018 20:08:07 +0000 (13:08 -0700)]
t/re/regexp.t: Silence HP-UX warnings
The tests that use t/re/re_tests may use a locale. It doesn't much
matter which locale, except we want one that isn't going to generate
warnings.
Karl Williamson [Tue, 27 Feb 2018 18:27:46 +0000 (11:27 -0700)]
perlapi: Fix typo
Daniel Dragan [Mon, 26 Feb 2018 02:31:26 +0000 (21:31 -0500)]
remove unreferenced copies of char * swash_property_names[]
Due to some MSVC bug or perl's not using MS specific CC options that I've
never figured out, MSVC does not remove unreferenced by a single .obj or
combine identical, static const data vars. MSVC funcs get removed &
combined correctly. Since for var swash_property_names removing it from
.objs that dont need it is very easy, do it. It saves some memory space.
Perhaps some other platforms/OSes/CCs have similar problems removing
unreferenced symbols from final binaries so this patch would help on those
CCs too.
regexec.c stopped using swash_property_names in commit
2a16ac9277 in 5.19.8
"regexec.c: Use compiled-in POSIX definitions"
regcomp.c stopped using swash_property_names in commit
bcb875216f in 5.19.8
"regcomp.c: Rmv code for delayed 'til runtime POSIX defns"
with MSVC 2008 64, before
miniperl.exe disk file size 1761KB .rdata virtual size 0xBC354 bytes
perl527.dll disk file size 2040KB .rdata virtual size 0xC9421 bytes
after this commit
miniperl.exe disk file size 1761KB .rdata virtual size 0xBC2C4 bytes
perl527.dll disk file size 2040KB .rdata virtual size 0xC9381 bytes
~144 bytes saved by removing unused copies of swash_property_names array.
There are other cases of large duplicate static const data vars still in
the perl527.dll binary but this patch covers a very simple case.
Father Chrysostomos [Mon, 26 Feb 2018 17:23:28 +0000 (09:23 -0800)]
warnings.pm: _at_level functions and chunky handles
The _at_level functions, which have to bypass Carp, were not
reporting non-line-based filehandles correctly. The perl core
does:
..., <fh> chunk 7.
if $/ is not "\n". warnings.pm should do the same. It was using
‘line’.
Father Chrysostomos [Mon, 26 Feb 2018 09:23:53 +0000 (01:23 -0800)]
Carp: Avoid run-time mods; StrVal workarounds
Carp needs to avoid loading modules while reporting errors, because
it may be invoked via $SIG{__DIE__} after a syntax error, when BEGIN
blocks are forbidden.
Before this commit (as of v5.27.8-360-gc99363a) it was doing just that
for reference arguments within stack traces.
That means we either need to load overload.pm at start-up so that
overload::StrVal is already available, or avoid overload::StrVal
altogether.
It turns out that various versions of overload::StrVal have
their own problems that prevent Carp from using them (out-
lined in the comments added to Carp.pm and also described at
<https://rt.perl.org/Ticket/Display.html?id=132902#txn-1535564>).
So we now follow two approaches: If overloading.pm is available, use
that; otherwise, use a hideous workaround inspired by ancient imple-
entations of overload::StrVal and Scalar::Util::blessed, while avoid-
ing the bugs in those old versions.
David Mitchell [Tue, 27 Feb 2018 15:32:25 +0000 (15:32 +0000)]
op.h: remove spurious # define indent
whitespace-only change
David Mitchell [Tue, 27 Feb 2018 14:58:18 +0000 (14:58 +0000)]
ext/File-Glob/t/rt131211.t: fix timing issues
This test file occasionally fails test numbers 1 and/or 2 on smokes.
These two tests measure how long it takes to do a matching and
non-matching glob() with a lot of "a*a*a*...." and fail if the
match and non-matching times differ too much (the original bug was that
non-match went exponential on number of "a*"'s).
However, on good systems, the timings returned are typically
sub-millisecond, so I'm guessing the occasional failures are due to
(small measured noise) * 100 > (another small measured noise).
So this commit avoids tests 1&2 failing unless the values measured
are large enough not to be merely noise.
This is just speculation on my part though - I couldn't reproduce a
failure myself.
Tony Cook [Mon, 26 Feb 2018 23:50:35 +0000 (10:50 +1100)]
(perl #127743) don't probe Storable limits so much (Win32 makefiles)
Win32 port of the changes in
8175eebc32
Karl Williamson [Mon, 26 Feb 2018 04:40:35 +0000 (21:40 -0700)]
APItest/t/locale.t: Add detail to test names
This detail can help in interpreting the results.
Karl Williamson [Mon, 26 Feb 2018 04:28:42 +0000 (21:28 -0700)]
Fix Perl_langinfo currency symbol for non-nl_langinfo systems
Commit
628ff75a4a7ac013dad43df7a53fcb55bf758ed7 broke this.
Tony Cook [Mon, 19 Feb 2018 23:10:34 +0000 (10:10 +1100)]
suppress error messages from the shell when probing Storable limits
Tony Cook [Mon, 19 Feb 2018 23:09:44 +0000 (10:09 +1100)]
make the Storable stacksize messages less scary
Tony Cook [Mon, 26 Feb 2018 04:04:20 +0000 (15:04 +1100)]
(perl #127743) don't probe Storable limits so much
Previously any rebuild on the perl executable or the shared library
would re-run the Storable recursion limit probing. Only do so
if the Storable binary or Storable.pm is rebuilt.
This needs to be ported to the Win32 makefiles too.
Father Chrysostomos [Mon, 26 Feb 2018 02:19:54 +0000 (18:19 -0800)]
[perl #132910] Carp: Avoid ->can
If a module has its own ‘can’ (or even UNIVERSAL::can) implementation,
it may impede Carp’s use of ->can to detect overloading. Instead,
use UNIVERSAL::can directly, or, in the presence of an override,
use overload::mycan. Don’t use overload::Overloaded, since old
versions of overload call ->can.
Yves Orton [Mon, 26 Feb 2018 00:42:22 +0000 (01:42 +0100)]
move init_i18nl10n(1) to after the ENTER in perl_construct
init_i18nl10n(1) uses SAVEFREEPV, before any ENTER is performed. Move it afterwards
Yves Orton [Mon, 26 Feb 2018 00:40:19 +0000 (01:40 +0100)]
Revert "Storable: when building in core do not run stacksize every time"
This reverts commit
345db0f66ed0ac7b609bb6bcceaf3a48b5f8e25b.
Father Chrysostomos [Sun, 25 Feb 2018 21:31:34 +0000 (13:31 -0800)]
Upgrade ExtUtils::MakeMaker to 7.33_03
Father Chrysostomos [Sun, 25 Feb 2018 21:29:36 +0000 (13:29 -0800)]
sync-with-cpan: Allow relative dir for tarball
Karl Williamson [Sun, 25 Feb 2018 19:51:59 +0000 (12:51 -0700)]
Fix Perl_langinfo() for non-nl_langinfo() systems
Commit
628ff75a4a7ac013dad43df7a53fcb55bf758ed7 caused the return value
to not be set for some paths through the function on platforms, like
Windows, that don't have nl_langinfo()
Karl Williamson [Sun, 25 Feb 2018 18:56:44 +0000 (11:56 -0700)]
locale.c: Silence compiler warning
The Windows compiler no longer raises a warning if we change this UV to
a plain unsigned.
Karl Williamson [Sat, 24 Feb 2018 23:32:44 +0000 (16:32 -0700)]
locale.c: Save needed value before destroying it
This moves up the copying of a needed value to before the place where it
could get destroyed. This only happened on some configurations under
some circumstances, which is why it got missed.
Karl Williamson [Sat, 24 Feb 2018 23:22:22 +0000 (16:22 -0700)]
locale.c: Let static fcn take a NULL argument
It turns out that it will be convenient in a future commit to have this
function handle NULL input. That also means that every call should use
the return value of this function.
Yves Orton [Sun, 25 Feb 2018 14:03:57 +0000 (15:03 +0100)]
Storable: when building in core do not run stacksize every time
Yves Orton [Sun, 25 Feb 2018 13:29:03 +0000 (14:29 +0100)]
if an SV IsCOW_shared_hash then we can assume it has a null at the end
H.Merijn Brand [Sun, 25 Feb 2018 15:57:33 +0000 (16:57 +0100)]
Correct (re)wording on defective HP-UX locales
Yves Orton [Sun, 25 Feb 2018 09:46:48 +0000 (10:46 +0100)]
add a svleak.t test for RT #132892
This tests the change applied in
910a6a8be166fb3780dcd2520e3526e537383ef2
I tested that when that commit is reverted this test fails,
and when it is in place it does not.
Father Chrysostomos [Sun, 25 Feb 2018 01:47:25 +0000 (17:47 -0800)]
Allow goto into glob’s arg
$ ./perl -Ilib -Xe 'goto foo; glob do { foo: $1}'
Can't "goto" into a binary or list expression at -e line 1.
What binary or list expression? True, glob has the *precedence* of a list operator, but so does not:
$ ./perl -Ilib -Xe 'goto foo; not do { foo: $1}; prt "ok\n"'
ok
Glob seems to be the only exception, due to its ‘special’ op tree.
Father Chrysostomos [Sun, 25 Feb 2018 01:43:26 +0000 (17:43 -0800)]
perlfunc:goto: Correct and clarify
Karl Williamson [Fri, 23 Feb 2018 18:13:09 +0000 (11:13 -0700)]
locale.c: Properly return LC_ALL locale names
On systems using POSIX 2008 functions that don't have querylocale(),
perl has to keep track of the locale names currently in effect. There
was code to invalidate LC_ALL as a single name if one or more of its
components aren't all the same. But omitted was code to re-validate it
when they later do become the same. This commit adds that omitted code.
Karl Williamson [Fri, 23 Feb 2018 18:06:45 +0000 (11:06 -0700)]
locale.c: Fix dangling set of LC_NUMERIC to C
In the past, we've kept LC_NUMERIC in the C locale, because so much code
relies on the radix character being a dot. 5.27.9 added an enhancement
that checks if the current locale already has it be a dot. If so, it's
fine to keep the locale in that one.
The spot fixed by this commit didn't get updated to account for this
change.
(I realize that the docs also need to be updated; that will be in a
future commit)
Karl Williamson [Fri, 23 Feb 2018 18:02:40 +0000 (11:02 -0700)]
t/loc_tools.pl: 8859-16 is legit; 8859-0 isn't
This adjusts the loop boundaries looking for come common locale names.
It was failing to look for 8859-16; instead looking for latin0, 8859-0,
which don't exist
Karl Williamson [Fri, 23 Feb 2018 17:59:33 +0000 (10:59 -0700)]
perlapi: Clarify Perl_langinfo()
Karl Williamson [Fri, 23 Feb 2018 17:46:53 +0000 (10:46 -0700)]
t/loc_tools.pl: Consider recently added warning
This file has functions that look for and return the valid locales on
the current system. A new incompatibility was discovered and a warning
generated for in
8b7358b96caf71db3213a7d72fc401e42ee0b2d.
This file should have been updated at that time to look for that message
to mean it the locale is not compatible. This commit updates it.
Karl Williamson [Fri, 23 Feb 2018 00:43:16 +0000 (17:43 -0700)]
Perl_langinfo(): Need to save return under more circumstances
I forgot that the internal static buffers returned from nl_langinfo()
and localconv() can be destroyed if the locale changes, and not just
from a subsequent call to the function. Therefore save the results
always.
Yves Orton [Sun, 25 Feb 2018 03:15:23 +0000 (04:15 +0100)]
Carp: add test for overloads without overload.pm
Yves Orton [Sun, 25 Feb 2018 03:07:15 +0000 (04:07 +0100)]
Carp: overloads can be enabled with via ::() as well as ::((
Yves Orton [Sun, 25 Feb 2018 03:04:02 +0000 (04:04 +0100)]
explain compile time effects of require
there is a difference between
require Foo::Bar;
and
require "Foo/Bar.pm";
in that the former will autovivify the Foo::Bar namespace at compile
time, but the latter will not. Populating the namespace is left to run
time in both cases.
This doc adds some details about this to the require entry in perlfunc
James E Keenan [Sat, 24 Feb 2018 19:01:23 +0000 (14:01 -0500)]
Spelling correction.
Addresses https://github.com/mhx/Devel-PPPort/pull/50/files.
Father Chrysostomos [Sat, 24 Feb 2018 18:14:45 +0000 (10:14 -0800)]
PathTools/Changes: Retroactively mention CPAN RT #114236
So that new releases will have a more complete and helpful
change log.
Yves Orton [Sat, 24 Feb 2018 16:42:00 +0000 (17:42 +0100)]
silence warnings when using zaphod32 on 64 bit builds
if STRLEN is 64 bit, then there is truncation when using key_len to initialize the state.
This causes problems with windows compilers especially. See comments from bulk88 in
perl #132860 (which is not directly related to this patch, but is where it was discussed)
Yves Orton [Sat, 24 Feb 2018 11:48:46 +0000 (12:48 +0100)]
Carp: add comment explaining the fix for perl #131046
In
4764858cb80e76fdba33cc1b3be8fcdef26df754 I added code that
eval's the argument extraction from DB::args() (code written by
both Pali and myself independently).
Unfortunately the commit message for that commit was somewhat
misleading, making it sound like the patch was a complete fix for
the underlying problem of stack-not-refcounted bugs, when in fact
it is actually a workaround, and a not-universally popular one
either due to its incompleteness. For more details of why it is
not popular see Zeframs commentary in
https://rt.perl.org/Public/Bug/Display.html?id=131046
Despite the concerns expressed by Zefram when considered from the
POV of a large enterprise using Carp to trap exceptions from
application code, having Carp throw its own exceptions about
stack-not-refcounted bugs and thus hiding the applications error
data is a significant issue.
So in
4764858cb80e76fdba33cc1b3be8fcdef26df754 we use eval to
handle those cases where Perl /can/ detect a stack-not-refcounted
error, and thus preserve as much of the applications error data
as possible.
This commit adds a comment to Carp which spells all of this out.
Yves Orton [Sat, 24 Feb 2018 11:37:29 +0000 (12:37 +0100)]
Fix perl #132902 - Carp: avoid infinite loops when checking for overloads
We use $obj->can("((") to see if a package has enabled overloads,
however in some cases can() is overridden with a custom implementation,
which may be unaware of these methods and then call Carp itself. This
then results in an infinite loop. An example is Class::Std v0.013.
While technically this is a bug in whatever overrides UNIVERSAL::can(),
Carp is so prolific in its use that we might as well treat it as a Carp
bug also and avoid the problem outright.
See also: https://github.com/chorny/Class-Std/pull/2
Yves Orton [Sat, 24 Feb 2018 04:42:51 +0000 (05:42 +0100)]
Revert "Revert "Carp: Avoid string eval""
This reverts commit
f61fbe7bb36915d6a598df82ede2511d261e41d3.
After further research it appears that this does NOT break .pmc's
The docs on .pmc's leave much to be desired.
Yves Orton [Sat, 24 Feb 2018 03:59:50 +0000 (04:59 +0100)]
Revert "Carp: Avoid string eval"
This reverts commit
7bb6e12450c58b7094ccdfa7025fa495d3996bcf.
This patch breaks the behavior of .pmc's. :-(
Until we decide if breaking this rarely used feature is ok I am reverting.
Father Chrysostomos [Sat, 24 Feb 2018 03:32:51 +0000 (19:32 -0800)]
Carp: Avoid string eval
Carp’s particular use of string eval is unnecessary in this case, and
slower than the alternative. Carp’s reason for using string eval is
to avoid the effect of bareword require vivifying a package. But that
only applies to bareword require, and not other forms of require:
$ perl -le 'print $::{"overload::"}||"nothing"; require overload'
*main::overload::
$ perl -le 'print $::{"overload::"}||"nothing"; require "overload.pm"'
nothing
Since string eval has to set up a parser and a new scope, it is much
slower that require, and quite unnecessary here.
Father Chrysostomos [Sat, 24 Feb 2018 01:59:09 +0000 (17:59 -0800)]
[perl #132854] Allow goto into first arg of bin op
This particular case does not risk any stack corruption, and there is
a CPAN module depending on it working (PerlX::AsyncAwait).
Zefram [Sat, 24 Feb 2018 00:40:13 +0000 (00:40 +0000)]
better comments about Carp overload logic
The comments originally added by commit
c99363aa273278adcad39f32026629b700f9bbc3 for [perl #132828] were unclear
and a bit over-excited.
Zefram [Sat, 24 Feb 2018 00:25:15 +0000 (00:25 +0000)]
remove spurious _ part of Carp version number
Commit
4764858cb80e76fdba33cc1b3be8fcdef26df754 unwisely
changed Carp's version number to an underscored one. Commit
c99363aa273278adcad39f32026629b700f9bbc3 incremented the underscored
part and copied it to Carp::Heavy. With blead being upstream for Carp,
there is no reason for it to have an underscored version number.
Karl Williamson [Wed, 27 Dec 2017 00:20:38 +0000 (17:20 -0700)]
perlretut: Clarify metacharacters
James E Keenan [Thu, 1 Feb 2018 02:59:21 +0000 (21:59 -0500)]
Ensure that we don't pick up any "system perl" libraries in @INC.
We need a tightly defined @INC which, for this test file, only needs './lib'
so that we can locate the two pragmata and Config.
For: RT # 132795
Yves Orton [Fri, 23 Feb 2018 03:13:49 +0000 (04:13 +0100)]
perl #132892: avoid leak by mortalizing temporary copy of pattern
Yves Orton [Sun, 18 Feb 2018 06:29:03 +0000 (07:29 +0100)]
fix Perl #132828 - dont use overload to bypass overloads
the internals don't need overload.pm to be loaded to enable overloads
which means that Carp needs to defend against overload without checking
if overload.pm is loaded either.
One odd thing about this change is that if I remove the "eval" that
wraps the "require" then we fail tests in dist/Carp/t/vivify_stash.t
which defies expectation as the require is never actually executed
from that code.
This patch doesn't have tests yet as it can segfault perl.
Pali [Wed, 31 Jan 2018 21:43:46 +0000 (22:43 +0100)]
Fix RT #52610: Carp: Do not crash when reading @DB::args
Trying to read values from array @DB::args can lead to perl fatal error
"Bizarre copy of ARRAY in scalar assignment". But missing, incomplete or
possible incorrect value in @DB::args is not a fatal error for Carp.
Carp is primary used for reporting warnings and errors from other
modules, so it should not crash perl when trying to print error message.
This patch safely iterates all elements of @DB::args array via eval { }
block and replace already freed scalars for Carp usage by string
"** argument not available anymore **".
This prevent crashing perl and allows to use Carp module. It it not a
proper fix but rather workaround for Carp module. At least it allows to
safely use Carp.
Patch amended by Yves Orton
Karl Williamson [Fri, 23 Feb 2018 04:45:42 +0000 (21:45 -0700)]
PATCH: [perl #132900] Blead Breaks CPAN: FELIPE/Crypt-Perl
The root cause of this was using a 'char' where it should have been
'U8'. I changed the signatures so that all the related functions take
and return U8's, and the compiler detects what should be cast to/from
char. The functions all deal with byte bit patterns, so unsigned is the
appropriate declaration.
Karl Williamson [Thu, 22 Feb 2018 21:21:23 +0000 (14:21 -0700)]
APItest:locale.t Fix ALT_DIGITS test
The value returned for ALT_DIGITS may vary by locale and platform.
Change the test to only look for a result, as opposed to a particular
result.
This should fix https://rt.perl.org/Ticket/Display.html?id=132879
but I'll leave the ticket open until that is verified.
reneeb [Tue, 20 Feb 2018 19:32:06 +0000 (20:32 +0100)]
update checkAUTHORS
reneeb [Tue, 20 Feb 2018 18:23:23 +0000 (19:23 +0100)]
add new release to perlhist
reneeb [Tue, 20 Feb 2018 18:14:55 +0000 (19:14 +0100)]
finalize perldelta for 5.27.9
reneeb [Tue, 20 Feb 2018 17:11:32 +0000 (18:11 +0100)]
update Module::CoreList for v5.27.9
David Mitchell [Tue, 20 Feb 2018 17:04:10 +0000 (17:04 +0000)]
t/op/index.t: indent run_tests() sub
(whitespace-only change)
The body of run_tests() had no indentation, meaning people didn't see it
and started adding tests outside the sub (see previous commit)
David Mitchell [Tue, 20 Feb 2018 17:01:28 +0000 (17:01 +0000)]
t/op/index.t: include all tests within run_tests()
Some tests were added at the end of the file, outside sub run_tests(),
so weren't being picked up by t/op/index_thr.t.
James E Keenan [Mon, 19 Feb 2018 13:19:22 +0000 (08:19 -0500)]
Add word apparently dropped in documentation.
H.Merijn Brand [Tue, 20 Feb 2018 10:55:17 +0000 (11:55 +0100)]
Move note about defective locale on HP-UX to README.hpux
David Mitchell [Tue, 20 Feb 2018 09:54:07 +0000 (09:54 +0000)]
S_do_trans_complex(): outdent a block of code
whitespace-only change left over from my recent tr///c fix work
David Mitchell [Tue, 20 Feb 2018 09:35:21 +0000 (09:35 +0000)]
fix nit in perl5278delta.pod
RT #132776
The :lvalue sub examples didn't have a valid body for an lvalue sub;
I've replaced the '1' with '...'
Karl Williamson [Tue, 20 Feb 2018 08:38:27 +0000 (01:38 -0700)]
Merge branch '\N{} handler refactoring ' into blead
This series of commits refactors a portion of the \N{} handling in
regcomp.c. This was done in preparation for allowing m'\N{...}', that
is single quoted patterns containing named characters. Currently this
is illegal.
The final step to do this is not quite ready to be committed. It
basically works, but the edge cases need to be looked at and tests
created, and the code freeze is upon us.
Some of the commits in this series are more than a year old, and I was
plagued with problems with rebasing, some of which I only resolved just
now, and decided to get this refactoring in before any more things come
along. I intend to fix
https://rt.perl.org/Ticket/Display.html?id=132163
during the code freeze, and I've started it out on the refactored code
used here, so it would be extra work to have to use the unrefactored
version.
Karl Williamson [Sun, 15 Jan 2017 00:55:24 +0000 (17:55 -0700)]
regcomp.c: Refactor some if-elses
if (foo) {
...
return
} else {
stuff
}
is equivalent to
if (foo) {
...
return
}
stuff
This commit changes the former to the latter, which also means moving
some declarations earlier, and some intialization later, and removing
some no longer valid code. This will be useful in the next commit.
Karl Williamson [Thu, 2 Mar 2017 19:15:20 +0000 (12:15 -0700)]
regcomp.c: White space only
This changes the indentation of some code to reflect where it should be
with the addition and subtraction of blocks in the next commits. And it
reflows to fit in 79 columns, and converts some tabs to spaces.
Karl Williamson [Thu, 2 Mar 2017 19:14:38 +0000 (12:14 -0700)]
regcomp.c: Simplify expression
The previous commit has made part of this 'if' redundant, so the whole
thing can be simplified.