This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perl5.git
6 years agoDon't create locale object unless threaded
Karl Williamson [Fri, 9 Mar 2018 19:06:30 +0000 (12:06 -0700)]
Don't create locale object unless threaded

PL_C_locale_obj is now only created on threaded builds on systems with
POSIX 2008.  On unthreaded builds, we really should continue to use the
old tried and true library calls.

6 years agoperl.h: Move some locale definitions around
Karl Williamson [Thu, 8 Mar 2018 21:43:23 +0000 (14:43 -0700)]
perl.h: Move some locale definitions around

For clarity, this places these locale definitions that depend solely on
having locales or not earlier, and by themselves, so don't get mixed up
with the definitions that have more complicated provenances.

In moving them, I also changed white space to accepted indentations,
and vertical alignment.

6 years agoperl.h: Rmv dummy definitions
Karl Williamson [Thu, 8 Mar 2018 21:32:28 +0000 (14:32 -0700)]
perl.h: Rmv dummy definitions

These macros are core-only, so should generate a compiler error if used
outside of core, instead of compiling as no-ops.

6 years agoDon't create unneeded mutexes
Karl Williamson [Fri, 9 Mar 2018 18:27:28 +0000 (11:27 -0700)]
Don't create unneeded mutexes

These mutexes are needed only for unsafe threaded-locale operations.

6 years agoLanginfo: Implement CODESET on Windows
Karl Williamson [Thu, 8 Mar 2018 20:00:40 +0000 (13:00 -0700)]
Langinfo: Implement CODESET on Windows

This applies to I18N::Langinfo, and the API function Perl_langinfo.
Windows doesn't have nl_langinfo, so an emulation is used.  It turns out
that it is easy to emulate the behavior for the CODESET item on Windows,
as that vendor has kept things consistent.

6 years agoPATCH: [perl #127288] I18N::Langinfo sets UTF-8 bit
Karl Williamson [Thu, 8 Mar 2018 05:48:55 +0000 (22:48 -0700)]
PATCH: [perl #127288] I18N::Langinfo sets UTF-8 bit

This commit will turn UTF-8 on in the returned SV if its string is legal
UTF-8 containing something besides ASCII, and the locale is a UTF-8 one.
It is based on the patch included in the ticket, but is generalized to
handle edge cases.

6 years agoI18N::Langinfo: fix pod nits
Karl Williamson [Wed, 7 Mar 2018 19:04:00 +0000 (12:04 -0700)]
I18N::Langinfo: fix pod nits

Removing trailing space; fix typo, clarify

6 years agoperlapi: Clarifications to Perl_langinfo
Karl Williamson [Wed, 7 Mar 2018 19:11:26 +0000 (12:11 -0700)]
perlapi: Clarifications to Perl_langinfo

6 years agoActually make I18N::Langinfo avail on all platforms
Karl Williamson [Thu, 8 Mar 2018 17:59:53 +0000 (10:59 -0700)]
Actually make I18N::Langinfo avail on all platforms

I thought I had done this earlier, but testing on Windows demonstrated
that I hadn't.

While at it, move the details in the docs for Perl_langinfo to the
module's pod.

This doesn't follow the paradigm for putting the Configure stuff in all
the related configure files, but I saw no point to doing so.  If you are
reading this because I was wrong, feel free to ticket it or fix it.

6 years agoChange enum names for new locale function parameters
Karl Williamson [Thu, 8 Mar 2018 17:51:09 +0000 (10:51 -0700)]
Change enum names for new locale function parameters

Earlier in the 5.27 series, I introduced Perl_langinfo which calls
the system nl_langinfo() on platforms that have it, and emulates it
otherwise.  For each enum parameter 'foo', I made an equivalent
parameter PERL_foo.  I did this so that no conflicts would arise if
any 'foo' were negative.  This is less than ideal to have to rename the
parameters.

In looking further, I realized that perl has always excluded the
possibility of negative values for 'foo', so my precaution is
unnecessary.  And before this new code is released is the time to fix up
the interface.

6 years agoAPItest/t/locale.t: Store hash return for readability
Karl Williamson [Wed, 7 Mar 2018 19:08:01 +0000 (12:08 -0700)]
APItest/t/locale.t: Store hash return for readability

6 years agoAPItest/t/locale.t: Sort some tests
Karl Williamson [Wed, 7 Mar 2018 19:05:46 +0000 (12:05 -0700)]
APItest/t/locale.t: Sort some tests

These now appear in the file in their logical order

6 years agoCarp: Use ${^LAST_FH} if available
Father Chrysostomos [Sun, 11 Mar 2018 22:28:27 +0000 (15:28 -0700)]
Carp: Use ${^LAST_FH} if available

Using ${^LAST_FH}, available in 5.18, in faster than using eval/die
to get the last file handle.

Also, the eval/die method is not going to produce anything if $. is 0
so skip that entire block if $. is false (by removing the defined check).

(Not significant enough for perldelta.  carp("zonk") gets faster by
only 5% or so.)

6 years agoLet cmp_version be run from the top level
Father Chrysostomos [Sun, 11 Mar 2018 21:25:14 +0000 (14:25 -0700)]
Let cmp_version be run from the top level

I’m used to typing ‘./perl -Ilib t/porting/cmp_version.t’; it’s annoy-
ing to have to add ‘-I.’.

(Obviously no perldelta entry necessary.)

6 years agowarnings.pm: sprintf is faster than concat
Father Chrysostomos [Sun, 11 Mar 2018 21:23:42 +0000 (14:23 -0700)]
warnings.pm: sprintf is faster than concat

I benchmarked this line alone in a one-liner and found the sprintf
variant to be roughly 10% faster than the concat version.  It’s also
more readable (and maintainable).

(Not significant enough to warrant a perldelta entry.)

6 years ago(perl #127743) re-work for debugging builds with MSVC
Tony Cook [Sun, 11 Mar 2018 23:53:05 +0000 (10:53 +1100)]
(perl #127743) re-work for debugging builds with MSVC

My original change here broke debugging builds, since tmp was no longer
available for the TRACEME.

6 years agot/lib/croak/regcomp: Another attempt to fix test failure
Karl Williamson [Sun, 11 Mar 2018 19:43:31 +0000 (13:43 -0600)]
t/lib/croak/regcomp: Another attempt to fix test failure

Commit e10187a7905cc53ffe233c0f091b3a7b3a6da4a9 failed to entirely fix
the failure, and this expands on that.

I had forgotten the pitfalls of using literal non-ASCIIs in tests

6 years agoperlrequick: Nits, clarifications
Karl Williamson [Wed, 27 Dec 2017 00:20:26 +0000 (17:20 -0700)]
perlrequick: Nits, clarifications

6 years agoregcomp.c: Quiet false warning
Karl Williamson [Sat, 10 Mar 2018 04:31:16 +0000 (21:31 -0700)]
regcomp.c: Quiet false warning

One compiler is complaining that this variable may be used
uninitialized.  It's not true, but set it to NULL anyway.

6 years agot/lib/croak/regcomp: Hopefully fix test failure
Karl Williamson [Fri, 9 Mar 2018 23:05:39 +0000 (16:05 -0700)]
t/lib/croak/regcomp: Hopefully fix test failure

This is failing on H. Merijn Brand's machines.  I can't reproduce it
there, but it makes sense that it has something to do with printing a
non-ASCII character, given that it's only failing under a particular
locale.  So try this simple solution.

6 years agoAvoid goto into glob test failure on VMS.
Craig A. Berry [Thu, 8 Mar 2018 17:59:49 +0000 (11:59 -0600)]
Avoid goto into glob test failure on VMS.

glob() does not return a list on VMS, so joining its result fails
expectations for this test.

6 years agolocale.c: Add missing STATIC
Karl Williamson [Thu, 8 Mar 2018 20:10:30 +0000 (13:10 -0700)]
locale.c: Add missing STATIC

Spotted by H. Merijn Brand

6 years agoremove empty file
Yves Orton [Thu, 8 Mar 2018 15:26:48 +0000 (16:26 +0100)]
remove empty file

6 years agoadd an empty file (to be removed next commit)
Yves Orton [Thu, 8 Mar 2018 15:14:38 +0000 (16:14 +0100)]
add an empty file (to be removed next commit)

6 years agoDon't run stack_after_err.t on VMS.
Craig A. Berry [Thu, 8 Mar 2018 13:50:33 +0000 (07:50 -0600)]
Don't run stack_after_err.t on VMS.

It uses IPC::Open3, which uses fork(), which doesn't exist.

6 years agofix line numbers in multi-line s///
David Mitchell [Wed, 7 Mar 2018 09:27:26 +0000 (09:27 +0000)]
fix line numbers in multi-line s///

my commit v5.25.6-230-g6432a58, "Eliminate SVrepl_EVAL and SvEVALED()",
introduced a regression: __LINE__ no longer took account of multiple
lines in the s///.

Now fixed.

Spotted by Abigail.

6 years ago(perl #132870) workaround VC2017 compiler bug
Tony Cook [Tue, 20 Feb 2018 05:18:05 +0000 (16:18 +1100)]
(perl #132870) workaround VC2017 compiler bug

For non-debug builds MSVC could read small integers like 1 as -255.

It's possible it was confused by the AIX compiler bug workaround.

This change needs no further tests, the integer.t fails without
this workaround.

6 years agormv/de-dup static const char array "strings"
Daniel Dragan [Thu, 1 Mar 2018 21:41:59 +0000 (16:41 -0500)]
rmv/de-dup static const char array "strings"

MSVC due to a bug doesn't merge identicals between .o'es or discard these
vars and their contents.

MEM_WRAP_CHECK_2 has never been used outside of core according to cpan grep
MEM_WRAP_CHECK_2 was removed on the "have PERL_MALLOC_WRAP" branch in
commit fabdb6c0879 "pre-likely cleanup" without explination, probably bc
it was unused. But MEM_WRAP_CHECK_2 was still left on the "no
PERL_MALLOC_WRAP" branch, so remove it from the "no" side for tidyness
since it was a mistake to leave it there if it was removed from the "yes"
side of the #ifdef.

Add MEM_WRAP_CHECK_s API, letter "s" means argument is string or static.
This lets us get rid of the "%s" argument passed to Perl_croak_nocontext at
a couple call sites since we fully control the next and only argument and
its guaranteed to be a string literal. This allows merging of 2
"Out of memory during array extend" c strings by linker now.

Also change the 2 op.h messages into macros which become string literals
at their call sites instead of "read char * from a global char **" which
was going on before.

VC 2003 32b perl527.dll section size before
  .text name
   DE503 virtual size
  .rdata name
   4B621 virtual size

after
  .text name
   DE503 virtual size
  .rdata name
   4B5D1 virtual size

6 years agoFile::Glob bsd_glob.c dont use "loop" as a goto label
Daniel Dragan [Tue, 6 Mar 2018 22:27:04 +0000 (17:27 -0500)]
File::Glob bsd_glob.c dont use "loop" as a goto label

Using loop as a label conflicts with Perl's "struct loop" and "LOOP" types
and Visual C 2003 in C++ mode (but not the default C build) doesn't like
that. The loop label is from 5.27.1 commit 0db967b2e6
"[perl #131211] fixup File::Glob degenerate matching"

bsd_glob.c(995) : error C2226: syntax error : unexpected type 'loop'

6 years agoPATCH: [perl #132163] regex assertion failure
Karl Williamson [Tue, 6 Mar 2018 19:32:58 +0000 (12:32 -0700)]
PATCH: [perl #132163] regex assertion failure

The original test case in this ticket has already been fixed; but
modifying it slightly showed some other issues that are now fixed by
this commit.

The deepest problem is that this code in some paths creates a string to
parse instead of the original pattern.  And in some cases, it's not even
the original pattern, but something that had already been created to
parse instead of the pattern.  Any messages that are raised should be
output in terms of the original.  regcomp.c already has the
infrastructure to handle the case where a message is raised during
parsing of a constructed string, but it can't handle a 2nd level
constructed string.  That was what led to the segfault in the original
ticket.  Unrelated fixes caused the original ticket to no longer be
applicable, and so this fix adds tests for things still would cause a
problem.

The method chosen here is to just make sure that the string constructed
here to parse is error free, so no messages will be raised.  Instead it
does the error checking as it constructs the string, so if what is being
parsed to construct a new string is an already constructed one, the
existing infrastructure handles outputting the message relative to the
original pattern.  Since what is being parsed is a series of hex
numbers, it's easy to find out what their values are: just accumulate a
total, shifting 4 bits each time through the loop.  A side benefit is
that this fixes some unreported bugs dealing with an input code point
that overflows.  Prior to this patch, it would error ungracefully.

6 years agoeliminate _REGEXP_COMMON macro from regexp.h
David Mitchell [Tue, 6 Mar 2018 15:50:21 +0000 (15:50 +0000)]
eliminate _REGEXP_COMMON macro from regexp.h

It is used in only one place now, so its better to expand it out rather
than having a complex struct's fields defined using a huge macro.

No functional changes, but I did take the opportunity to tidy up the
formatting of the code comments for each struct field

6 years agoop_dump(): display op_next to self as [SELF]
David Mitchell [Tue, 6 Mar 2018 15:24:38 +0000 (15:24 +0000)]
op_dump(): display op_next to self as [SELF]

Normally op_next (and similar) fields of an op are displayed with the
address and basic details of the op they point to, e.g.

    5    gvsv PADOP(0x1b7ac48) ===> 5 [sassign 0x1b7ab80]

This commit enhances that so that if the field points back to the op
containing the field (as is often the case during the early phases of
building an op tree), instead display it as just:

    5    gvsv PADOP(0x1b7ac48) ===> [SELF]

6 years agoinline.h: #define some constants for EBCDIC
Karl Williamson [Tue, 6 Mar 2018 15:18:26 +0000 (08:18 -0700)]
inline.h: #define some constants for EBCDIC

I thought these weren't needed on EBCDIC builds, but it turns out there
is occasion for them.

6 years agopp_repeat: avoid calling GIMME_V twice
David Mitchell [Tue, 6 Mar 2018 15:08:23 +0000 (15:08 +0000)]
pp_repeat: avoid calling GIMME_V twice

assign its value to a local var instead. GIMME_V can have a considerable
overhead when called in unknown context.

I audited the rest of the pp*.c files, but didn't find any similar
multiple calls.

6 years agoTux' smoke reports moved
H.Merijn Brand [Tue, 6 Mar 2018 12:09:25 +0000 (13:09 +0100)]
Tux' smoke reports moved

due to re-allocation of available hosts, Tux has now hosted the smoke
reports somewhere else

6 years agot/run/locale.t: Fix skip count; uninit warning
Karl Williamson [Tue, 6 Mar 2018 06:37:55 +0000 (23:37 -0700)]
t/run/locale.t: Fix skip count; uninit warning

Spotted by Tony Cook

6 years agoperldelta for b857191d01c2, 74e28a4a737c
Tony Cook [Tue, 6 Mar 2018 04:39:47 +0000 (15:39 +1100)]
perldelta for b857191d01c274e28a4a737c

6 years ago(perl #132925) don't use $0 to get the name of mk_invlists.pl
Tony Cook [Thu, 1 Mar 2018 04:42:56 +0000 (15:42 +1100)]
(perl #132925) don't use $0 to get the name of mk_invlists.pl

Other regen scripts simply embed the name as a literal, using $0
means that the output varies depending on the path used to call
regen/mk_invlists.pl.

6 years ago(perl #132925) correct path handling in mktables
Tony Cook [Thu, 1 Mar 2018 04:26:22 +0000 (15:26 +1100)]
(perl #132925) correct path handling in mktables

the lexical my $file inside the loop masked the for loop $file,
wasting the work done to canonicalize the path names.

The grep on length is required since splitdir() can return empty
strings.

6 years agoRevert "charclasslists.h: script enums visible to CORE,EXT"
Karl Williamson [Tue, 6 Mar 2018 00:17:38 +0000 (17:17 -0700)]
Revert "charclasslists.h: script enums visible to CORE,EXT"

This reverts commit fea79782ed31ac4faa71eb6193faff54b4bbe249.

This bloats perl, and is not now necessary for 5.28.

6 years agoEBCDIC conditional compilation fixes
Karl Williamson [Mon, 5 Mar 2018 18:16:15 +0000 (11:16 -0700)]
EBCDIC conditional compilation fixes

The recent changes fixed by this commit neglected to take into account
EBCDIC differences.

Mostly, the algorithms apply only to ASCII platforms, so the EBCDIC is
ifdef'd out.  In a couple cases, the algorithm mostly applies, so the
scope of the ifdefs is smaller.

6 years agoregexec.c: White-space only
Karl Williamson [Mon, 5 Mar 2018 18:12:14 +0000 (11:12 -0700)]
regexec.c: White-space only

Properly indent preprocessor directives

6 years agoinline.h: White-space only
Karl Williamson [Mon, 5 Mar 2018 18:08:58 +0000 (11:08 -0700)]
inline.h: White-space only

Properly indent preprocessor directives

6 years agoperldiag: Rewrap an entry for better splain output
Father Chrysostomos [Mon, 5 Mar 2018 17:55:34 +0000 (09:55 -0800)]
perldiag: Rewrap an entry for better splain output

The splain utility (aka diagnostics.pm) blindly strips out pod formatting
without rewrapping the text (I think rewrapping would be overkill).  This
means that formatting like ‘L<Note [5] in
perlrecharclass|perlrecharclass/[5]>’ turns into a simple ‘Note [5] in
perlrecharclass’, which can mess up the indentation.

Rewrap the entry to compensate, plus a few other tweaks to improve
the appearance of the right margin.

6 years agoMore AUTHORS sorting
Father Chrysostomos [Mon, 5 Mar 2018 17:35:21 +0000 (09:35 -0800)]
More AUTHORS sorting

6 years agoAUTHORS: sorting; consistent indent
Father Chrysostomos [Mon, 5 Mar 2018 16:58:09 +0000 (08:58 -0800)]
AUTHORS: sorting; consistent indent

6 years agoIncrease ExtUtils::ParseXS(::*) version to 3.39
Father Chrysostomos [Mon, 5 Mar 2018 16:46:41 +0000 (08:46 -0800)]
Increase ExtUtils::ParseXS(::*) version to 3.39

6 years agoAdd Shoichi Kaji to AUTHORS
Father Chrysostomos [Mon, 5 Mar 2018 16:39:36 +0000 (08:39 -0800)]
Add Shoichi Kaji to AUTHORS

6 years agoRT #132935: correctly check VERSIONs in ExtUtils::ParseXS
Shoichi Kaji [Mon, 5 Mar 2018 14:25:49 +0000 (23:25 +0900)]
RT #132935: correctly check VERSIONs in ExtUtils::ParseXS

The following version check does not work correctly:

BEGIN { $VERSION = '3.38' }
use ExtUtils::ParseXS::Constants $VERSION;

The reason is that we must use version "literals",
not "variables" in `use Module VERSION`.
For the sake of ease of maintenance,
we use "require" and "->VERSION", instead of "use" here.

6 years agoperldiag typo
Father Chrysostomos [Mon, 5 Mar 2018 06:05:46 +0000 (22:05 -0800)]
perldiag typo

6 years agoRT #132834: prevent duplicate Config.pm vars
Aaron Crane [Mon, 5 Mar 2018 09:22:46 +0000 (09:22 +0000)]
RT #132834: prevent duplicate Config.pm vars

Commit 6c2ae6421675ba5ff81dd43f9167136f02dfe9d9 introduced variables whose
need was forced by configpm (for compatibility with older software), but
incorrectly added those variables to the generated Config_heavy.pl even when
they were already in use.

The resulting duplicate variables are clearly wrong, and in addition they
broke ExtUtils::InferConfig.

6 years agoloc_tools.pl: Properly exclude iffy locales
Karl Williamson [Sun, 4 Mar 2018 19:51:25 +0000 (12:51 -0700)]
loc_tools.pl: Properly exclude iffy locales

This code (fragiley) uses the wording of a warning message to determine
if a locale has issues or not.  Commit
578a6a873a320fe64743b060dbd467f1865d205c updated the message this is
looking for, but failed to update this file correspondingly.

6 years agoperlapi: utf8_to_uvuni_buf() Add clarification
Karl Williamson [Sun, 4 Mar 2018 17:57:16 +0000 (10:57 -0700)]
perlapi: utf8_to_uvuni_buf() Add clarification

6 years agot/run/locale.t: Add, revise tests
Karl Williamson [Sun, 4 Mar 2018 17:47:08 +0000 (10:47 -0700)]
t/run/locale.t: Add, revise tests

This enhances the test added in bee74f4b9818f0ca72926dd6b4dfdbc6b75c59ef
so that it is doing a valid setlocale, and adds a similar test for doing
an invalid one.

6 years agot/loc_tools.pl: Add fcn to return valid locale cats
Karl Williamson [Sun, 4 Mar 2018 17:45:05 +0000 (10:45 -0700)]
t/loc_tools.pl: Add fcn to return valid locale cats

This new function will return the locale categories known to this
platform.

6 years agot/run/locale.t: Update skip count
Karl Williamson [Sun, 4 Mar 2018 17:43:03 +0000 (10:43 -0700)]
t/run/locale.t: Update skip count

This should have been updated by
bee74f4b9818f0ca72926dd6b4dfdbc6b75c59ef.

6 years agolocale.c: Fix bug in parsing a locale
Karl Williamson [Sun, 4 Mar 2018 02:21:03 +0000 (19:21 -0700)]
locale.c: Fix bug in parsing a locale

This was not handling the case where there is a semi-colon separated
list of individual locales, except the last one had no trailing
semi-colon.

Thanks to Sergey Aleynikov for finding this

6 years agolocale.c: Check return code
Karl Williamson [Sun, 4 Mar 2018 02:17:43 +0000 (19:17 -0700)]
locale.c: Check return code

In cases like these, we should give up if the called function fails.

6 years agolocale.c: Replace an 'if' by an assert
Karl Williamson [Sun, 4 Mar 2018 02:15:07 +0000 (19:15 -0700)]
locale.c: Replace an 'if' by an assert

This should be true if we get to here.

6 years agolocale.c: Increase debug buffer size
Karl Williamson [Sun, 4 Mar 2018 01:56:25 +0000 (18:56 -0700)]
locale.c: Increase debug buffer size

A case was found where this was too small

6 years agolocale.c: Rmv spurious Safefree
Karl Williamson [Sun, 4 Mar 2018 01:54:26 +0000 (18:54 -0700)]
locale.c: Rmv spurious Safefree

I misread the documentation, and Perl_form doesn't need its return value
freed; it's already declared to be temporary, so if this code actually
got executed, there'd be a wrong pool panic

6 years agolocale.c: Remove redundant SAVE_ERRNO
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

6 years agoperlguts: Clarify an example.
Karl Williamson [Sun, 4 Mar 2018 00:27:48 +0000 (17:27 -0700)]
perlguts: Clarify an example.

6 years agoReword warning for deviations from UTF-8 locales
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.

6 years agoBump version of POSIX.pm to 1.83; warnings to 1.42
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

6 years agoperldelta typo
Father Chrysostomos [Fri, 2 Mar 2018 18:52:45 +0000 (10:52 -0800)]
perldelta typo

6 years agoperldelta for Carp changes since 5.27.9
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.

6 years agoRemove 5.27.9 entries from 5.27.10’s delta
Father Chrysostomos [Fri, 2 Mar 2018 18:30:51 +0000 (10:30 -0800)]
Remove 5.27.9 entries from 5.27.10’s delta

6 years agoregen
Sawyer X [Fri, 2 Mar 2018 18:11:13 +0000 (20:11 +0200)]
regen

6 years agoBump Module::CoreList
Sawyer X [Fri, 2 Mar 2018 18:11:08 +0000 (20:11 +0200)]
Bump Module::CoreList

6 years agoBump version
reneeb [Tue, 20 Feb 2018 21:41:22 +0000 (22:41 +0100)]
Bump version

6 years agoNew Perldelta
reneeb [Tue, 20 Feb 2018 21:31:17 +0000 (22:31 +0100)]
New Perldelta

6 years agoTick release in release schedule
reneeb [Tue, 20 Feb 2018 21:24:23 +0000 (22:24 +0100)]
Tick release in release schedule

6 years agoUpdate epigraph.pod
reneeb [Tue, 20 Feb 2018 21:23:18 +0000 (22:23 +0100)]
Update epigraph.pod

6 years agomg.c: Fix isSCRIPT_RUN call
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.

6 years ago[MERGE] fixups for attributes-before-signatures
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.

6 years agodetect sub attributes following a signature
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.

6 years agosubtly change meaning of XATTRBLOCK, XATTRTERM
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.

6 years agorationalise subroutine parsing rules
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.

6 years agoparse subs and signature subs separately
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.

6 years agoadd Perl_init_named_cv() functiom
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.

6 years agoMerge remote-tracking branch 'renee/release-5.27.9' into blead
Sawyer X [Fri, 2 Mar 2018 12:55:14 +0000 (14:55 +0200)]
Merge remote-tracking branch 'renee/release-5.27.9' into blead

6 years agoperl.h: Add comment about clang warnings
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

6 years agoRemove parameter from isSCRIPT_RUN
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.

6 years agoSilence wrong clang warnings
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.

6 years agonumeric.c: Refactor code to use only one RESTORE
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.

6 years agoregen/regcomp.pl: close FH before unlink
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.

6 years agoremove unused var in sv_eq_flags
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.

6 years ago(perl #132893) don't probe for Storable recursion limits on old Win32
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

6 years agoWe hope to release 5.26.2 and 5.24.4 together in March
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

6 years agorework Carp/t/stack_after_err.t to not use perl -e
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

6 years agoCarp: Speed up longmess some more
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.

6 years agot/re/regexp.t: Silence HP-UX warnings
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.

6 years agoperlapi: Fix typo
Karl Williamson [Tue, 27 Feb 2018 18:27:46 +0000 (11:27 -0700)]
perlapi: Fix typo

6 years agoremove unreferenced copies of char * swash_property_names[]
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.

6 years agowarnings.pm: _at_level functions and chunky handles
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’.

6 years agoCarp: Avoid run-time mods; StrVal workarounds
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.

6 years agoop.h: remove spurious # define indent
David Mitchell [Tue, 27 Feb 2018 15:32:25 +0000 (15:32 +0000)]
op.h: remove spurious #  define indent

whitespace-only change

6 years agoext/File-Glob/t/rt131211.t: fix timing issues
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.

6 years ago(perl #127743) don't probe Storable limits so much (Win32 makefiles)
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