This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perl5.git
7 years agopodcheck.t: Use new Pod::Checker
Karl Williamson [Wed, 25 May 2016 17:10:18 +0000 (11:10 -0600)]
podcheck.t: Use new Pod::Checker

podcheck.t extends the Pod::Checker class.  Pod::Checker has been
rewritten to base off of Pod::Simple instead of Pod::Parser, and so
podcheck.t must switch to use use the completely new methods defined.

7 years agoUpdate Pod::Checker to CPAN version 1.72
Karl Williamson [Wed, 25 May 2016 17:10:23 +0000 (11:10 -0600)]
Update Pod::Checker to CPAN version 1.72

This is now based on Pod::Simple instead of Pod::Parser

podcheck.t will fail until the next commit is done.

7 years agoSubject: Pod::Checker: convert files from DOS to unix
Karl Williamson [Thu, 26 May 2016 23:33:32 +0000 (17:33 -0600)]
Subject: Pod::Checker: convert files from DOS to unix

This is in preparation for applying patches to these.  git am failed on
these.  Only files that need to be DOS should be.

The version is bumped to 1.72, which is what version the real patches
are from.

7 years agopodcheck.t: Move a declaration
Karl Williamson [Wed, 25 May 2016 16:40:51 +0000 (10:40 -0600)]
podcheck.t: Move a declaration

This just moves a variable declaration and initialization to elsewhere
in the file where it can be used in a different place in a future
commit.  And it is now placed where it is more visible, as it really is
a program-level definition.

The code is outdented as well, and the comment unwrapped to be on a
single line, but no other changes were made.

7 years agoregcomp.c: Add shortcuts to some inversion list ops
Karl Williamson [Thu, 3 Mar 2016 21:24:39 +0000 (14:24 -0700)]
regcomp.c: Add shortcuts to some inversion list ops

When taking the union or intersection of two inversion lists, not
infrequently the result is the same as one of the inputs.  An example is
the union of a set that contains all code points with any other set.
The result is the set that contains all code points.  Also, not
infrequently, the result is to overwrite one of the inputs.  If the
other input contributed nothing to the result, the whole operation is
effectively a no-op, as the result has the same contents as the input it
overwrites.

It turns out that it is cheap to keep track of if just one input
contributes to the result.  This commit does that, and short-circuits
the rest of the code if it is going to turn out to be a no-op.

7 years agoext/VMS-DCLsym/DCLsym.pm: Fix missing pod reference
Karl Williamson [Thu, 26 May 2016 01:23:57 +0000 (19:23 -0600)]
ext/VMS-DCLsym/DCLsym.pm: Fix missing pod reference

This looks like it was meant to point to a later heading or item in the
document, but which was removed at some point, with the reference left
dangling.  I confirmed with Craig Berry that what it is referring to is
the text in the next paragraph.

7 years agoDevel::Peek: Fix a couple of pod glitches
Karl Williamson [Wed, 25 May 2016 04:14:59 +0000 (22:14 -0600)]
Devel::Peek: Fix a couple of pod glitches

7 years agoporting/dual-life.t: Clarify test messages
Karl Williamson [Wed, 25 May 2016 01:35:17 +0000 (19:35 -0600)]
porting/dual-life.t: Clarify test messages

This changes the message output by the ok() sub to show precisely what
is being tested

7 years agofix locale.c under -DPERL_GLOBAL_STRUCT(_PRIVATE)
David Mitchell [Wed, 25 May 2016 18:15:27 +0000 (19:15 +0100)]
fix locale.c under -DPERL_GLOBAL_STRUCT(_PRIVATE)

With that build option initialised statics aren't allowed (no BSS).
So just disable using $ENV{PERL_DEBUG_LOCALE_INIT} under
-DPERL_GLOBAL_STRUCT.

7 years agoporting/libperl.t: better diag output
David Mitchell [Wed, 25 May 2016 17:50:10 +0000 (18:50 +0100)]
porting/libperl.t: better diag output

when it complains about unexpected BSS symbols, list them

7 years agoadd missing dVAR in pp_avhvswitch
David Mitchell [Wed, 25 May 2016 17:30:17 +0000 (18:30 +0100)]
add missing dVAR in pp_avhvswitch

make it build under -DPERL_GLOBAL_STRUCT.

7 years agoExtUtils::ParseXS: Silence some pod warnings
Karl Williamson [Wed, 25 May 2016 03:31:13 +0000 (21:31 -0600)]
ExtUtils::ParseXS: Silence some pod warnings

These were found by the new Pod::Checker, soon to be committed.

7 years agoPathTools: fix Pod::Checker warning for pod
Karl Williamson [Wed, 25 May 2016 03:23:59 +0000 (21:23 -0600)]
PathTools: fix Pod::Checker warning for pod

The new Pod::Checker soon to be commited doesn't like lines with only
white space.

7 years agoPod::Functions/Functions_pm.PL: Fix pod error
Karl Williamson [Thu, 28 Apr 2016 22:53:40 +0000 (16:53 -0600)]
Pod::Functions/Functions_pm.PL: Fix pod error

This is trailing white space, that is warned against by the
new version of Pod::Checker that is soon to be committed.

7 years agolocale.c: don't use strcpy()
David Mitchell [Tue, 24 May 2016 22:45:48 +0000 (23:45 +0100)]
locale.c: don't use strcpy()

A recent commit added a strcpy() to locale.c.

This is Frowned Upon, and was making porting/libperl.t fail.

Since PL_strxfrm_min_char appears to be a 3-byte buffer, I've just changed
it to manually copy 3 individual bytes - which is probably more efficient
than a full-blown Copy(). But I haven't looked closely at whether this is
correct - this is more of quick fix to get smoking passing again.

7 years agolocale.c: Make locale collation predictions adaptive
Karl Williamson [Fri, 13 May 2016 17:32:44 +0000 (11:32 -0600)]
locale.c: Make locale collation predictions adaptive

We try to avoid calling strxfrm() more than needed by predicting its
needed buffer size.  This generally works because the size of the
transformed string is roughly linear with the size of the input string.
But the key word here is "roughly".  This commit changes things, so that
when we guess low, we change the coefficients in the equation to guess
higher the next time.

7 years agolocale.c: Not so aggressive collation memory use guess
Karl Williamson [Tue, 12 Apr 2016 20:28:57 +0000 (14:28 -0600)]
locale.c: Not so aggressive collation memory use guess

On platforms where  strxfrm() is not well-behaved, and it fails because
it needs a larger buffer, prior to this commit, the size was doubled
before trying again.  This could require a lot of memory on large
inputs.  I'm uncomfortable with such a big delta on very large strings.
This commit changes it so it is not so aggressive.  Note that this now
only gets called on platforms whose strxfrm() is not well behaved, and I
think the size prediction is better due to a recent commit, and there
isn't really much of a downside in not gobbling up memory so fast.

7 years agolocale.c: Add some debugging statements
Karl Williamson [Wed, 18 May 2016 19:18:01 +0000 (13:18 -0600)]
locale.c: Add some debugging statements

7 years agolocale.c: Minor cleanup
Karl Williamson [Wed, 18 May 2016 19:17:25 +0000 (13:17 -0600)]
locale.c: Minor cleanup

This replaces an expression with what I think is an easier to understand
macro, and eliminates a couple of temporary variables that just
cluttered things up.

7 years agolocale.c: Fix some debugging so will output during init
Karl Williamson [Sun, 15 May 2016 00:23:02 +0000 (18:23 -0600)]
locale.c: Fix some debugging so will output during init

Because the command line options are currently parsed after the locale
initialization is done, an environment variable is read to allow
debugging of the function that is called to do the initialization.
However, any functions that it calls, prior to this commit, were unaware
of this and so did not output debugging.  This commit fixes most of
them.

7 years agomv function from locale.c to mathoms.c
Karl Williamson [Tue, 12 Apr 2016 18:49:36 +0000 (12:49 -0600)]
mv function from locale.c to mathoms.c

The previous commit causes this function being moved to be just a
wrapper not called in core.  Just in case someone is calling it, it is
retained, but moved to mathoms.c

7 years agoDo better locale collation in UTF-8 locales
Karl Williamson [Wed, 18 May 2016 02:50:55 +0000 (20:50 -0600)]
Do better locale collation in UTF-8 locales

On some platforms, the libc strxfrm() works reasonably well on UTF-8
locales, giving a default collation ordering.  It will assume that every
string passed to it is in UTF-8.  This commit changes Perl to make sure
that strxfrm's expectations are met.

Likewise under a non-UTF-8 locale, strxfrm is expecting a non-UTF-8
string.   And this commit makes sure of that as well.

So, simply meeting strxfrm's expectations allows Perl to start
supporting default collation in UTF-8 locales, and fixes it to work on
single-byte locales with UTF-8 input.  (Unicode::Collate provides
tailorable functionality and is portable to platforms where strxfrm
isn't as intelligent, but is a much more heavy-weight solution that may
not be needed for particular applications.)

There is a problem in non-UTF-8 locales if the passed string contains
code points representable only in UTF-8.  This commit causes them to be
changed, before being passed to strxfrm, into the highest collating
character in the locale that doesn't require UTF-8.  They then will sort
the same as that character, which means after all other characters in
the locale but that one.  In strings that don't have that character,
this will generally provide exactly correct operation.  There still is a
problem, if that character, in the given locale, combines with adjacent
characters to form a specially weighted sequence.  Then, the change of
these above-255 code points into that character can skew the results.
See the commit message for 6696cfa7cc3a0e1e0eab29a11ac131e6f5a3469e for
more on this.  But it is really an illegal situation to have above-255
code points in a single-byte locale, so this behavior is a reasonable
degradation when given illegal input.  If two transformed strings
compare exactly equal, Perl already uses the un-transformed versions to
break ties, and there, these faked-up strings will collate so the
above-255 code points sort after everything else, and in code point
order amongst themselves.

7 years agoperllocale: Change headings so two aren't identical
Karl Williamson [Tue, 12 Apr 2016 19:51:48 +0000 (13:51 -0600)]
perllocale: Change headings so two aren't identical

Two html anchors in this pod were identical, which isn't a problem
unless you try to link to one of them, as the next commit does

7 years agoChange calculation of locale collation coefficients
Karl Williamson [Tue, 12 Apr 2016 17:21:40 +0000 (11:21 -0600)]
Change calculation of locale collation coefficients

Every time a new collation locale is set, two coefficients are calculated
that are used in predicting how much space is needed in the
transformation of a string by strxfrm().  The transformed string is
roughly linear with the the length of the input string, so we are
calcaulating 'm' and 'b' such that

    transformed_length = m * input_length + b

Space is allocated based on this prediction.  If it is too small, the
strxfrm() will fail, and we will have to increase the allotted amount
and try again.  It's better to get the prediction right to avoid
multiple, expensive strxfrm() calls.

Prior to this commit, the calculation was not rigorous, and failed on
some platforms that don't have a fully conforming strxfrm().

This commit changes to not panic if a locale has an apparent defective
collation, but instead silently change to use C-locale collation.  It
could be argued that a warning should additionally be raised.

This commit fixes [perl #121734].

7 years agolocale.c: Change algorithm for strxfrm() trials
Karl Williamson [Tue, 12 Apr 2016 01:11:07 +0000 (19:11 -0600)]
locale.c: Change algorithm for strxfrm() trials

It's kind of guess work deciding how big a buffer to give to strxfrm().
If you give it too small a one, it will fail.  Prior to this commit, the
buffer size was doubled and then strxfrm() was called again, looping
until it worked, or we used too much memory.

Each time a new locale is made, we try to minimize the necessity of
doing this by calculating numbers 'm' and 'b' that can be plugged into
the equation

    mx + b

where 'x' is the size of the string passed to strxfrm().  strxfrm() is
roughly linear with respect to its input's length, so this generally
works without us having to do many loops to get a large enough size.

But on many systems, strxfrm(), in failing, returns how much space you
should have given it.  On such systems, we can just use that number on
the 2nd try and not have to keep guessing.  This commit changes to do
that.

But on other systems this doesn't work.  So the original method is
retained if we determine that there are problems with strxfrm(), either
from previous experience, or because using the size returned from the
first trial didn't work

7 years agolocale.c: Free over-allocated space early
Karl Williamson [Sun, 10 Apr 2016 02:40:48 +0000 (20:40 -0600)]
locale.c: Free over-allocated space early

We may over malloc some space in buffers to strxfrm().  This frees it
now instead of waiting for the whole block to be freed sometime later.
This can be a significant amount of memory if the input string to
strxfrm() is long.

7 years agolocale.c: White-space only
Karl Williamson [Sun, 10 Apr 2016 02:36:01 +0000 (20:36 -0600)]
locale.c: White-space only

Outdent and reflow because the previous commit removed an enclosing
block.

7 years agoChange mem_collxfrm() algorithm for embedded NULs
Karl Williamson [Sat, 9 Apr 2016 21:52:05 +0000 (15:52 -0600)]
Change mem_collxfrm() algorithm for embedded NULs

One of the problems in implementing Perl is that the C library routines
forbid embedded NUL characters, which Perl accepts.  This is true for
the case of strxfrm() which handles collation under locale.

The best solution as far as functionality goes, would be for Perl to
write its own strxfrm replacement which would handle the specific needs
of Perl.  But that is not going to happen because of the huge complexity
in handling it across many platforms.  We would have to know the
location and format of the locale definition files for every such
platform.  Some might follow POSIX guidelines, some might not.

strxfrm creates a transformation of its input into a new string
consisting of weight bytes.  In the typical but general case, a 3
character NUL-terminated input string 'A B C 00' (spaces added for
readability) gets transformed into something like:
    A¹ B¹ C¹ 01 A² B² C² 01 A³ B³ C³ 00
where the superscripted characters are weights for the corresponding
input characters.  Superscript 1 represents (essentially) the primary
sorting key; 2, the secondary, etc, for as many levels as the locale
definition gives.  The 01 byte is likely to be the separator between
levels, but not necessarily, and there could be some other mechanisms
used on various platforms.

To handle embedded NULs, the simplest thing would be to just remove them
before passing in to strxfrm().  Then they would be entirely ignored,
which might not be what you want.  You might want them to have some
weight at the tertiary level, for example.  It also causes problems
because strxfrm is very context sensitive.  The locale definition can
define weights for specific sequences of any length (and the weights can
be multi-byte), and by removing a NUL, two characters now become
adjacent that weren't in the input, and they could now form one of those
special sequences and thus throw things off.

Another way to handle NULs, that seemingly ignores them, but actually
doesn't, is the mechanism in use prior to this commit.  The input string
is split at the NULs, and the substrings are independently passed to
strxfrm, and the results concatenated together.  This doesn't work
either.  In our example 'A B C 00', suppose B is a NUL, and should have
some weight at the tertiary level.  What we want is:
    A¹ C¹ 01 A² C² 01 A³ B³ C³ 00

But that's not at all what you get.  Instead it is:
    A¹ 01 A² 01 A³ C¹ 01 C² 01 C³ 00
The primary weight of C comes immediately after the teriary weight of A,
but more importantly, a NUL, instead of being ignored at the primary
levels, is significant at all levels, so that "a\0c" would sort before
"ab".

Still another possibility is to replace the NUL with some other
character before passing it to strxfrm.  That was my original plan, to
replace each NUL with the character that this code determines has the
lowest collation order for the current locale.  On strings that don't
contain that character, the results would be as good as it gets for that
locale.  That character is likely to be ignored at higher weight levels,
but have some small non-ignored weight at the lowest ones.  And
hopefully the character would rarely be encountered in practice.  When
it does happen, it and NUL would sort identically; hardly the end of the
world.  If the entire strings sorted identically, the NUL-containing one
would come out before the other one, since the original Perl strings are
used as a tie breaker.  However, testing showed a problem with this.  If
that other character is part of a sequence that has special weighting,
the results won't be correct.  With gcc, U+00B4 ACUTE ACCENT is the
lowest collating character in many UTF-8 locales.  It combines in
Romanian and Vietnamese with some other characters to change weights,
and hence changing NULs into U+B4 screws things up.

What I finally have come to is to do is a modification of this final
approach, where the possible NUL replacements are limited to just
characters that are controls in the locale.  NULs are replaced by the
lowest collating control.  It would really be a defective locale if this
control combined with some other character to form a special sequence.
Often the character will be a 01, START OF HEADING.  In the very
unlikely case that there are absolutely no controls in the locale, 01 is
used, because we have to replace it with something.

The code added by this commit is mostly utf8-ready.  A few commits from
now will make Perl properly work with UTF-8 (if the platform supports
it).  But until that time, this isn't a full implementation; it only
looks for the lowest-sorting control that is invariant, where the
the UTF8ness doesn't matter.  The added tests are marked as TODO until
then.

7 years agolocale.c: Add, move, clarify comments
Karl Williamson [Wed, 18 May 2016 03:53:53 +0000 (21:53 -0600)]
locale.c: Add, move, clarify comments

This moves a large block of comments to before a block, outdents it, and
adds to it, plus adding another comment

7 years agoKeep track of if collation locale is UTF-8 or not
Karl Williamson [Mon, 16 May 2016 21:19:14 +0000 (15:19 -0600)]
Keep track of if collation locale is UTF-8 or not

This will be used in future commits

7 years agolocale.c: Don't use special locale collation for C locale
Karl Williamson [Mon, 16 May 2016 21:15:26 +0000 (15:15 -0600)]
locale.c: Don't use special locale collation for C locale

We can skip all the locale collation calculations if the locale we are
in is C or POSIX.

7 years agoperllocale: Document NUL collation handling
Karl Williamson [Sat, 21 May 2016 17:35:10 +0000 (11:35 -0600)]
perllocale: Document NUL collation handling

And add a TODO test, because this shortly will be improved upon

7 years agolib/locale.t: Don't calculate value unless needed
Karl Williamson [Fri, 13 May 2016 17:51:55 +0000 (11:51 -0600)]
lib/locale.t: Don't calculate value unless needed

7 years agomathoms.c: Remove obsolete text
Karl Williamson [Mon, 23 May 2016 16:01:41 +0000 (10:01 -0600)]
mathoms.c: Remove obsolete text

makedef.pl no longer needs special handling for any functions that get
moved to mathoms.c

7 years agoUpdate ExtUtils-MakeMaker to CPAN version 7.18
Chris 'BinGOs' Williams [Tue, 24 May 2016 10:39:59 +0000 (11:39 +0100)]
Update ExtUtils-MakeMaker to CPAN version 7.18

  [DELTA]

7.18  Mon May 23 15:55:26 BST 2016

    No changes since 7.17_03

7.17_03 Wed May 11 18:22:06 BST 2016

    Dist fixes:
    - remove build_requires on ourselves

7.17_02 Mon May  9 23:55:09 BST 2016

    Bug fixes:
    - Resolve a regression in c_o with trailing spaces

7.17_01 Mon May  9 20:02:02 BST 2016

    Test fixes:
    - Resolve issues with tests when running in core

7.16  Sat May  7 10:13:05 BST 2016

    No changes since 7.15_03

7.15_03 Sun May  1 14:13:44 BST 2016

    Bug fixes:
    - lazy load Time::HiRes in ExtUtils::Command::MM
    - fix 5.6 compat by removing indexed sprintf

7.15_02 Thu Apr 28 12:54:23 BST 2016

    Bug fixes:
    - Fix regression with small fractional numeric versions

7.15_01 Wed Apr 27 19:13:46 BST 2016

    Bug fixes:
    - Fix regression with SKIP and dynamic and static targets

7.14  Sun Apr 24 13:53:33 BST 2016

  No changes since 7.13_01

7.13_01 Sat Apr 23 16:41:20 BST 2016

    Bug fixes:
    - Make dynamic depend on config again, fixes issues with Inline

7.12 Tue Apr 19 12:24:41 BST 2016

    Enhancements:
    - version ranges are now supported for PREREQS, etc.
    - Metadata is now represented internally as Meta Spec 2.0
    - ExtUtils::Command has been re-incorporated at 1.19 of that module
    - Refactored XS handling
    - XSMULTI=>1 - put multiple *.xs under lib, it "just works" and XSBUILD
      for refined control of XSMULTI
    - can do "make test" without first doing "make"

    Bug fixes:
    - Handle new warnings from File::Path
    - Resolve RT#106572 specifying AUTHOR via command-line is broken
    - Warning on missing TEST_REQUIRES and CONFIGURE_REQUIRES
    - Sanitise make_type on Win32
    - Cygwin rebase fixes
    - Makefile starting comments reflect decoded @ARGV, not raw
    - Add various targets to .PHONY to avoid disk IO with dmake
    - Fixed race condition in realclean
    - improve static-build lib detection
    - Eliminate non-error STDERR
    - Make WriteEmptyMakefile Makefile functional when called in subdir
    - manifypods fixes
    - perllocal.pod generation "Perl in Space" fix
    - PASTHRU fixes
    - Fix distsignature dependencies for parallel make
    - Check exit status for commands in "make ci" target
    - Less noisey output during building sub-modules
    - Fix dos2unix() on Windows
    - stop makeaperl from polluting @ARGV in cases where ARGV contains args with spaces
    - Fix regression when both test.pl and t/*.t are present
    - Refactored internals to remove DirHandle usage
    - MM_Unix::find_perl() dont repeatedly stat the same path in a loop
    - No longer repeatedly attempt to load CPAN::Meta if it is now available

    VMS fixes:
    - Made MM_VMS::oneline build continuation lines properly
    - Implemented XSMULTI and XSBUILD
    - Resurrect PASTHRU on VMS
    - make_macro should handle multiple macros
    - Fix regression with File::Spec changes in previous release

    Win32 fixes:
    - t/echo.t needs SHELL env for Win32 gmake

    Dist fixes:
    - Made %ExtraPrereqs match bundled prereqs
    - Included MANIFEST.SKIP from ExtUtils::Manifest
    - The bundled Encode::Locale has been updated to 1.04

    Test fixes:
    - test PL_FILES of a "module"
    - Various tests no longer require a separate .pm file for testing
    - Support v5.6.1 in various tests
    - test static build if $ENV{AUTHOR_TESTING}
    - XS tests now pluggable
    - test for "Perl in Space"

    Doc fixes:
    - better document for PL_FILES, oneliner method
    - FAQ updated

7 years agoFix class name typo typo in perlootut example
Dagfinn Ilmari Mannsåker [Tue, 24 May 2016 10:25:49 +0000 (11:25 +0100)]
Fix class name typo typo in perlootut example

It's spelled correctly in the body text, but the code had it wrong.

7 years agomathoms.c: consolidate comments
David Mitchell [Mon, 23 May 2016 14:53:05 +0000 (15:53 +0100)]
mathoms.c: consolidate comments

The head of this source file contains quite a few general comment
paragraphs. Consolidate them all into one

  /*
   *
   */

block.

7 years agomathoms.c: add explanation why fns must be kept
David Mitchell [Mon, 23 May 2016 14:45:20 +0000 (15:45 +0100)]
mathoms.c: add explanation why fns must be kept

See http://nntp.perl.org/group/perl.perl5.porters/236384.

7 years agoPATCH: [perl #128219] typo in perlrecharclass
Karl Williamson [Mon, 23 May 2016 14:04:53 +0000 (08:04 -0600)]
PATCH: [perl #128219] typo in perlrecharclass

Thanks for spotting this.  It was a typo.  Alpha matches XPosixAlpha.

7 years agoCX_POP_SAVEARRAY(): use more distinctive var name
David Mitchell [Mon, 23 May 2016 13:43:56 +0000 (14:43 +0100)]
CX_POP_SAVEARRAY(): use more distinctive var name

Under -Wshadow, CX_POP_SAVEARRAY's local var 'av' can generate this
warning:

    warning: declaration shadows a local variable [-Wshadow]

So rename it to cx_pop_savearay_av to reduce the risk of a clash.

(See http://nntp.perl.org/group/perl.perl5.porters/236444)

7 years agoUpdate release link in epigraph for 5.25.1
Sawyer X [Sun, 22 May 2016 17:10:41 +0000 (19:10 +0200)]
Update release link in epigraph for 5.25.1

7 years agoUpdate Module::CoreList for 5.25.2
Sawyer X [Sun, 22 May 2016 17:00:13 +0000 (19:00 +0200)]
Update Module::CoreList for 5.25.2

7 years agoperldiag: Rewrite a mangled sentence
Father Chrysostomos [Sun, 22 May 2016 01:33:38 +0000 (18:33 -0700)]
perldiag: Rewrite a mangled sentence

7 years agoSort perldiag
Father Chrysostomos [Sun, 22 May 2016 01:31:26 +0000 (18:31 -0700)]
Sort perldiag

7 years agorecognize and reject version control conflict markers (RT #127993)
Lukas Mai [Sat, 21 May 2016 17:12:21 +0000 (19:12 +0200)]
recognize and reject version control conflict markers (RT #127993)

7 years agoFix STRESS_REALLOC after 3caf0269d
Father Chrysostomos [Sat, 21 May 2016 18:36:56 +0000 (11:36 -0700)]
Fix STRESS_REALLOC after 3caf0269d

This commit:

commit 3caf0269dd4c609b8c2bc22b54598c642ba63ed8
Author: David Mitchell <davem@iabyn.com>
Date:   Sun Dec 27 14:07:02 2015 +0000

    offset PL_savestack_max by SS_MAXPUSH

stopped savestack_grow from adding 4 to the allocated amount, which
broke builds with -Accflags=-DSTRESS_REALLOC.

savestack_grow accepts no arguments.  The callers have no way to
tell it how much to allocate; they just assume that it will allocate
enough.  By default, in increases the stack size by 50%, and the stack
starts out at 128 elements, so everything works fine.

Under STRESS_REALLOC, introduced by commit 2ce36478e5 in ’98, the
savestack started out at 1 (later, SS_MAXPUSH; as of 3caf0269d,
PL_savestack_max is 0 initially, though the actual stack size is
SS_MAXPUSH).  And the stack-growing functions in scope.h that default
to 50% instead add 1 element to the stack.

Anything that calls savestack_grow assumes it will allocate enough for
the savestack elements pushed.  The most elements ever pushed at once
is 4, so 2ce36478e5 added a +4 to the size in savestack_grow.

3caf0269d removed that +4, so the stack is only incremented by 1, and
this assertion at the end of scope.h:SS_ADD_END failed:

    if (UNLIKELY(ix > PL_savestack_max)) savestack_grow();      \
    assert(PL_savestack_ix <= PL_savestack_max);

3caf0269d was right in removing the +4, since it is unnecessary for
normal builds.  For STRESS_REALLOC, which is designed to grow stacks
as little as possible, we were allocating one more element than neces-
sary.  So this commit just explicitly grows the stack by SS_MAXPUSH
(the new name for 4) in savestack_grow if STRESS_REALLOC is defined.

7 years agoUpdate for the version thats on the CPAN
Chris 'BinGOs' Williams [Sat, 21 May 2016 15:46:12 +0000 (16:46 +0100)]
Update for the version thats on the CPAN

7 years agoSimplify parser’s handling of my/local
Father Chrysostomos [Sat, 21 May 2016 12:42:55 +0000 (05:42 -0700)]
Simplify parser’s handling of my/local

In Perl 5.000, the same token, LOCAL, was used for both ‘my’ and
‘local’, with a token value, passed to localize() as a second argu-
ment, to distinguish between them.

perl-5.003_07-9-g55497cf (inseparable changes from patch from
perl5.003_07 to perl5.003_08), for no apparent reason, split them into
two tokens, removing the token values and assigning values in perly.y
via $$ = 0 and $$ = 1.  They still ultimately made their way through
the same grammar rule, as there was only one localize() call in
perly.y.  The code still made sense.

perl-5.005_02-1816-g09bef84 (sub : attrlist) changed things, such that
the tokens are separate *and* they get separate token values assigned
to them.  ‘local’ and ‘my’ no longer follow the same grammar rules
in perly.y, so there are separate localize() calls for the different
token types.  Hence, the use of a token value to distinguish them does
not make sense.  It just makes this more complicated that necessary.

So this commit removes the token values.  Since the two token types
follow different paths through perly.y and have separate localize()
calls, we can hard-code the argument to localize() there, instead of
passing the value through from toke.c as a token value.

This does shrink toke.o slightly (for me it went from 876040 to
876000), and it makes this conceptually clearer.

7 years ago[perl #128204] Fix crash with @a &.= etc.
Father Chrysostomos [Sat, 21 May 2016 04:55:40 +0000 (21:55 -0700)]
[perl #128204] Fix crash with @a &.= etc.

The new bitwise operators in their assignment forms were not correctly
catching things like arrays on the lhs at compile time.

At run time, they would either crash or croak with ‘Can’t coerce
ARRAY...’.

This commit puts in the correct compile-time check, simply by flagging
these as scalar modifiers.

7 years agoAnother op description correction: & -> &.
Father Chrysostomos [Sat, 21 May 2016 03:32:48 +0000 (20:32 -0700)]
Another op description correction: & -> &.

The string bitwise ops have dots in them, which should be included
in the op descriptions.

7 years agoCorrect ‘bitiwse’ in two op descriptions
Father Chrysostomos [Sat, 21 May 2016 03:24:50 +0000 (20:24 -0700)]
Correct ‘bitiwse’ in two op descriptions

Oops!

7 years ago[Merge] &CORE::foo() calls with keys, push, etc.
Father Chrysostomos [Sat, 21 May 2016 05:14:08 +0000 (22:14 -0700)]
[Merge] &CORE::foo() calls with keys, push, etc.

The hash and array functions, keys, each, values, push, pop, shift,
unshift and splice, can now be called with ampersand syntax and via
reference.

7 years agoUpdate CORE.pod to reflect &CORE::keys() etc.
Father Chrysostomos [Sat, 21 May 2016 04:57:32 +0000 (21:57 -0700)]
Update CORE.pod to reflect &CORE::keys() etc.

7 years agoAllow assignment to &CORE::keys()
Father Chrysostomos [Sat, 21 May 2016 00:50:23 +0000 (17:50 -0700)]
Allow assignment to &CORE::keys()

7 years agoAllow &CORE::foo() with array functions
Father Chrysostomos [Tue, 17 May 2016 07:27:30 +0000 (00:27 -0700)]
Allow &CORE::foo() with array functions

7 years agoperldiag: Document unknown OA_* panic
Father Chrysostomos [Tue, 17 May 2016 06:32:06 +0000 (23:32 -0700)]
perldiag: Document unknown OA_* panic

7 years agof
Father Chrysostomos [Sat, 21 May 2016 05:13:15 +0000 (22:13 -0700)]
f

7 years agoAllow &CORE::foo() with hash functions
Father Chrysostomos [Tue, 17 May 2016 06:10:17 +0000 (23:10 -0700)]
Allow &CORE::foo() with hash functions

&CORE::keys does not yet work as an lvalue.  (I’m not sure how to make
that work.)

7 years agoIncrease $Opcode::VERSION to 1.35
Father Chrysostomos [Tue, 17 May 2016 01:16:28 +0000 (18:16 -0700)]
Increase $Opcode::VERSION to 1.35

7 years agoAdd avhvswitch op
Father Chrysostomos [Tue, 17 May 2016 01:15:42 +0000 (18:15 -0700)]
Add avhvswitch op

&CORE::keys() et al. will use this to switch between keys and akeys
depending on the argument type.

7 years agoregen/opcodes: Re-order aeach, akeys, and avalues
Father Chrysostomos [Tue, 17 May 2016 01:09:02 +0000 (18:09 -0700)]
regen/opcodes: Re-order aeach, akeys, and avalues

In a forthcoming commit, I will need them to be in the same order as
the corresponding hash functions.

7 years agopp.c: Use PL_op_desc in pp_coreargs
Father Chrysostomos [Sun, 15 May 2016 20:59:24 +0000 (13:59 -0700)]
pp.c: Use PL_op_desc in pp_coreargs

OP_DESC is inconvienient here, because it expects an op, not an op
number, so we have to follow pointers to find an appropriate op.  It
is also needlessly expensive, since we do not need to check for custom
ops in pp_coreargs (which OP_DESC does).  Just access the underlying
array directly.

7 years agoUpgrade to threads 2.09
jdhedden [Fri, 20 May 2016 18:59:02 +0000 (14:59 -0400)]
Upgrade to threads 2.09

For: RT #128197

7 years agoUpgrade to Thread::Queue 3.11
jdhedden [Fri, 20 May 2016 18:33:31 +0000 (14:33 -0400)]
Upgrade to Thread::Queue 3.11

For: RT #128195

7 years agoIncrement $VERSION to 5.YYYYMMDD for next scheduled monthly release date.
James E Keenan [Sat, 21 May 2016 01:59:46 +0000 (21:59 -0400)]
Increment $VERSION to 5.YYYYMMDD for next scheduled monthly release date.

7 years agocorelist: update for v5.25.2
Father Chrysostomos [Sat, 21 May 2016 01:04:52 +0000 (18:04 -0700)]
corelist: update for v5.25.2

I really have no idea what I’m doing.  I just copied 4170737e2, sort of,
and the tests started passing.

7 years ago[Merge] Lexical subs are no longer experimental
Father Chrysostomos [Fri, 20 May 2016 23:00:09 +0000 (16:00 -0700)]
[Merge] Lexical subs are no longer experimental

7 years agoGive feature.pm the concept of no-op features
Father Chrysostomos [Fri, 20 May 2016 21:30:14 +0000 (14:30 -0700)]
Give feature.pm the concept of no-op features

7 years agoRemove @experimental from regen/feature.pl
Father Chrysostomos [Fri, 20 May 2016 21:17:55 +0000 (14:17 -0700)]
Remove @experimental from regen/feature.pl

Originally, we were going to have feature.pm warning when enabling
an experimental feature.  That changed, though, when we introduced
the :all tag, because it is unkind for :all to warn.  So in
v5.17.6-49-g64fbf0d we started warning when a feature is used,
not enabled.

It does not appear that that will ever change, so we might as well
remove the dead code (and comments) from regen/feature.pl.

7 years agoUpdate other docs on lexical sub acceptance
Father Chrysostomos [Fri, 20 May 2016 21:11:30 +0000 (14:11 -0700)]
Update other docs on lexical sub acceptance

7 years agoIncrease $feature::VERSION to 1.44
Father Chrysostomos [Fri, 20 May 2016 20:26:17 +0000 (13:26 -0700)]
Increase $feature::VERSION to 1.44

7 years agoUpdate feature.pm docs for lex sub acceptance
Father Chrysostomos [Fri, 20 May 2016 20:25:20 +0000 (13:25 -0700)]
Update feature.pm docs for lex sub acceptance

7 years agoUpdate perldiag for lexsub diag removals
Father Chrysostomos [Fri, 20 May 2016 19:46:07 +0000 (12:46 -0700)]
Update perldiag for lexsub diag removals

7 years agoEnable lex subs everywhere; suppress warning
Father Chrysostomos [Fri, 20 May 2016 19:45:10 +0000 (12:45 -0700)]
Enable lex subs everywhere; suppress warning

Adjust tests, too.

7 years ago[perl #128187] Forbid keys @_ in assigned lv sub
Father Chrysostomos [Fri, 20 May 2016 13:22:40 +0000 (06:22 -0700)]
[perl #128187] Forbid keys @_ in assigned lv sub

This is a continuation of this commit’s great grandparent, extending
the error to arrays.

7 years agotoke: yylex comments
Father Chrysostomos [Fri, 20 May 2016 04:32:02 +0000 (21:32 -0700)]
toke: yylex comments

Update; clarify; fix typo.

7 years agoCorrect error msg for sub:lvalue{%h{k}} in sassign
Father Chrysostomos [Fri, 20 May 2016 01:31:56 +0000 (18:31 -0700)]
Correct error msg for sub:lvalue{%h{k}} in sassign

This:

    sub foo : lvalue { %hash{'key'} }
    foo = 3;

was incorrectly giving ‘Can't modify key/value hash slice in list
assignment’.  There is no list assignment there.

7 years ago[perl #128187] Forbid sub :lvalue{keys} in aassign
Father Chrysostomos [Fri, 20 May 2016 01:27:24 +0000 (18:27 -0700)]
[perl #128187] Forbid sub :lvalue{keys} in aassign

This commit makes perl die when keys(%hash) is returned from an lvalue
sub and the lvalue sub call is assigned to in list assignment:

    sub foo : lvalue { keys(%INC) }
    (foo) = 3; # death

This prevents an assignment that is completely useless and probably a
mistake, and it makes the lvalue-sub use of keys behave the same way
as (keys(%INC)) = 3.

7 years agoNote latest stable in INSTALL:
Sawyer X [Fri, 20 May 2016 22:39:12 +0000 (00:39 +0200)]
Note latest stable in INSTALL:

This was in the instructions but as it appears right after bumping
the version number (which contains a note that BLEAD-POINT should
only do it later), I had missed it. Also, INSTALL is generally
updated by the bump version script, which is usually done the
version before.

Anyway, might as well fix it now.

7 years agoBump the perl version in various places for 5.25.2
Sawyer X [Fri, 20 May 2016 22:08:13 +0000 (00:08 +0200)]
Bump the perl version in various places for 5.25.2

7 years agonew delta for 5.25.2
Sawyer X [Fri, 20 May 2016 22:03:08 +0000 (00:03 +0200)]
new delta for 5.25.2

7 years agomark 5.25.1 release as done
Sawyer X [Fri, 20 May 2016 21:53:53 +0000 (23:53 +0200)]
mark 5.25.1 release as done

7 years agoAdd epigraph to list:
Sawyer X [Fri, 20 May 2016 21:53:16 +0000 (23:53 +0200)]
Add epigraph to list:

NNTP link not available yet, I'll update it in the near future
(tomorrow) when it's available.

7 years ago[MERGE] resolve conflicts and merge 5.25.1 release with blead
Sawyer X [Fri, 20 May 2016 21:46:30 +0000 (23:46 +0200)]
[MERGE] resolve conflicts and merge 5.25.1 release with blead

7 years agoadd new release to perlhist v5.25.1
Sawyer X [Fri, 20 May 2016 19:47:28 +0000 (21:47 +0200)]
add new release to perlhist

7 years agoupdated perldelta
Sawyer X [Fri, 20 May 2016 19:25:04 +0000 (21:25 +0200)]
updated perldelta

7 years agoUpdate Module::CoreList for 5.25.1
Sawyer X [Fri, 20 May 2016 16:08:40 +0000 (18:08 +0200)]
Update Module::CoreList for 5.25.1

7 years agoadd a change to perldelta
Sawyer X [Fri, 20 May 2016 15:20:58 +0000 (17:20 +0200)]
add a change to perldelta

7 years agoImporting not-useful POSIX subs now fails at import time.
Jarkko Hietaniemi [Fri, 20 May 2016 11:38:31 +0000 (07:38 -0400)]
Importing not-useful POSIX subs now fails at import time.

7 years agoIndirect object syntax fixed in FileHandle.pm
Chase Whitener [Wed, 18 May 2016 16:20:28 +0000 (12:20 -0400)]
Indirect object syntax fixed in FileHandle.pm

Increment $FileHandle::VERSION.

For: RT #128178

7 years agoCorrect POD for release managers document:
Sawyer X [Thu, 19 May 2016 20:01:57 +0000 (22:01 +0200)]
Correct POD for release managers document:

A literal / (solidus) is E<sol>.

7 years agoUpdate and correct release schedule:
Sawyer X [Thu, 19 May 2016 19:54:32 +0000 (21:54 +0200)]
Update and correct release schedule:

* The release schedule had the dates for some releases twice
  and they weren't the same. Ricardo Signes released 5.24.0 sooner
  than on the schedule (good thing, since we kept slipping away)
  so that's fixed.

* We're releasing 5.25.1 tomorrow, on May, instead of June. That
  means all numbers are bumped.

* Aaron Crane volunteered to take on the November release.
  (Joke's on him, he'll have to do it!)

7 years ago[perl #123367] Test my sub defined in BEGIN{eval}
Father Chrysostomos [Thu, 19 May 2016 13:08:12 +0000 (06:08 -0700)]
[perl #123367] Test my sub defined in BEGIN{eval}

This accidentally started working in v5.21.6-197-g0f94cb1.

7 years agoAllow require_error.t be run from the top level
Father Chrysostomos [Thu, 19 May 2016 04:42:03 +0000 (21:42 -0700)]
Allow require_error.t be run from the top level

7 years agoNo such thing as MACOSX_DEVELOPMENT_TARGET.
Craig A. Berry [Thu, 19 May 2016 11:35:49 +0000 (06:35 -0500)]
No such thing as MACOSX_DEVELOPMENT_TARGET.

This appears to be a typo that has been with us since 69625aa92a9
and the real name is MACOSX_DEPLOYMENT_TARGET.

So do the same thing the MacPorts folks have been doing, meaning
this is just the "fix-ld-modification.patch" from:

https://trac.macports.org/browser/trunk/dports/lang/perl5/files/5.24?rev=148407

7 years agoperldelta for 08f800f85 / #128182
Father Chrysostomos [Thu, 19 May 2016 03:14:26 +0000 (20:14 -0700)]
perldelta for 08f800f85 / #128182

7 years ago[perl #128182] Fix crash with require $nonstring
Father Chrysostomos [Thu, 19 May 2016 01:07:37 +0000 (18:07 -0700)]
[perl #128182] Fix crash with require $nonstring

If something other than a plain string (e.g. a reference or typeglob)
whose stringified form contains a null character is passed to require()
or do(), it crashes, as of v5.19.3-130-gc8028aa, because the code in
question that handles the error tries to read fields of the scalar
that are only valid if it is a string internally.

7 years agolexsub.t: Remove some unnecessary evals
Father Chrysostomos [Thu, 19 May 2016 00:54:28 +0000 (17:54 -0700)]
lexsub.t: Remove some unnecessary evals

These evals were originally of the form eval {...} when I added
the tests, before things were working.  When I got them working,
I left few evals by mistake, while removing the braces.  Luckily,
eval 44 produces the same thing as 44.

7 years agoAdd POSIX::tmpnam() removal into perldelta
Jarkko Hietaniemi [Thu, 19 May 2016 02:45:13 +0000 (22:45 -0400)]
Add POSIX::tmpnam() removal into perldelta

7 years agoperldelta update
Father Chrysostomos [Wed, 18 May 2016 20:39:22 +0000 (13:39 -0700)]
perldelta update

fcd1306 [perl #128106] Fix reset with non-globs
60a26c7 [perl #128086] Fix precedence in hv_ename_delete
69e7f50 [perl #127976] Restore ‘or array’ to each($s) err
94f9945 Fix crash with: undef *_; shift;
c349280 Use concat overloading for "foo$_->$*"
d674449 [perl #128171] Fix assert fail with /@0{0*->@*/*0