This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perl5.git
7 years agoTime-HiRes: avoid going negative on struct timespec
Jarkko Hietaniemi [Fri, 4 Mar 2016 02:11:38 +0000 (21:11 -0500)]
Time-HiRes: avoid going negative on struct timespec

7 years agoTime-HiRes: refactor common timespec subtraction code
Jarkko Hietaniemi [Fri, 4 Mar 2016 02:25:30 +0000 (21:25 -0500)]
Time-HiRes: refactor common timespec subtraction code

7 years agoTime-HiRes: for nanosleeps, zero is success
Jarkko Hietaniemi [Thu, 3 Mar 2016 23:23:52 +0000 (18:23 -0500)]
Time-HiRes: for nanosleeps, zero is success

Testing for zero makes it slightly less odd-looking than bang.

7 years agoTime-HiRes: use NV_1E6 and NV_1E9 consistently
Jarkko Hietaniemi [Thu, 3 Mar 2016 23:21:42 +0000 (18:21 -0500)]
Time-HiRes: use NV_1E6 and NV_1E9 consistently

7 years agoTime-HiRes: initialize the unslept timespec
Jarkko Hietaniemi [Thu, 3 Mar 2016 22:29:58 +0000 (17:29 -0500)]
Time-HiRes: initialize the unslept timespec

Found by clang scan-build.

7 years agothreads.xs: create new static fn S_jmpenv_run()
David Mitchell [Fri, 4 Mar 2016 17:36:57 +0000 (17:36 +0000)]
threads.xs: create new static fn S_jmpenv_run()

S_jmpenv_run() replaces 3 similar pieces of code that do
JMPENV_PUSH(); ... stuff ...; JMPENV_POP().

As a side effect of this commit, it gets rid of this annoying warning
under g++:

    warning: variable ‘my_perl’ might be clobbered by ‘longjmp’

7 years agorpeep(): eliminate compiler warning
David Mitchell [Fri, 4 Mar 2016 10:59:21 +0000 (10:59 +0000)]
rpeep(): eliminate compiler warning

    op.c: In function ‘Perl_rpeep’:
    op.c:13692:37: warning: comparison is always false due to limited
    range of data type [-Wtype-limits]
                             ? base : 0) >
                                     ^
replace the '0' with something that still always fails to match but
hopefully won't warn.

7 years agoSimplify _MEM_WRAP_NEEDS_RUNTIME_CHECK()
David Mitchell [Thu, 3 Mar 2016 10:59:57 +0000 (10:59 +0000)]
Simplify _MEM_WRAP_NEEDS_RUNTIME_CHECK()

And at the same time hopefully avoid some false-positive compiler warnings
on HP-UX

7 years agoPATCH: [perl #126141]: qr/]]]]][\\/ fails to raise error
Karl Williamson [Fri, 4 Mar 2016 20:14:30 +0000 (13:14 -0700)]
PATCH: [perl #126141]: qr/]]]]][\\/ fails to raise error

This was due to the trailing \ trying to look at the next character
without verifying that one actually existed.

7 years agoregcomp.c: Fix a memory leak
Karl Williamson [Fri, 4 Mar 2016 18:59:18 +0000 (11:59 -0700)]
regcomp.c: Fix a memory leak

This revises 5751998882d1db1c0f62a32a0b16e58176928a35 so that it works
if a called function fails to return (it was failing if there was
illegal tainting going on).

7 years agolocale.c: Avoid a leak
Karl Williamson [Fri, 4 Mar 2016 17:12:43 +0000 (10:12 -0700)]
locale.c: Avoid a leak

This reorders things to allow a free to be done.  The cause was spotted
by Tony Cook.

7 years agoPOSIX.xs: Avoid a leak in setlocale()
Karl Williamson [Fri, 4 Mar 2016 16:34:40 +0000 (09:34 -0700)]
POSIX.xs: Avoid a leak in setlocale()

Tony Cook suggested this fix.

7 years agoTODO or skip certain failing locale tests on cygwin
Karl Williamson [Mon, 22 Feb 2016 18:27:50 +0000 (11:27 -0700)]
TODO or skip certain failing locale tests on cygwin

This is a known problem which cygwin has fixed in 2.5

Tony Cook tested this and found and fixed several bugs in it before this
final version was made.

7 years agoregcomp.c: Revise, add comments, white-space changes
Karl Williamson [Thu, 3 Mar 2016 21:21:05 +0000 (14:21 -0700)]
regcomp.c: Revise, add comments, white-space changes

7 years agoregcomp.c: Avoid a memory leak
Karl Williamson [Thu, 3 Mar 2016 16:56:41 +0000 (09:56 -0700)]
regcomp.c: Avoid a memory leak

The croak is using heap storage for an argument.  Making that
SAVEFREEPV() will make sure it gets freed.

7 years agoregcomp.c: White-space only
Karl Williamson [Thu, 3 Mar 2016 16:40:55 +0000 (09:40 -0700)]
regcomp.c: White-space only

Outdent and reflow comments because the previous commit removed a
surrounding block.

7 years agoReinstate "PATCH: {perl #127582] Over eager warning for /[.foo.]/""
Karl Williamson [Thu, 3 Mar 2016 05:10:58 +0000 (22:10 -0700)]
Reinstate "PATCH: {perl #127582] Over eager warning for /[.foo.]/""

This reverts commit ab9a4aa72166b26d6c3556107c19ba08ee956a88 which
itself reverted commit a9149dfda17b511d34bb2af869948b677be52fbc, thus
reinstating the original.  But this new commit also adds a check to
avoid going off the end of a buffer, the absence of which was the cause
for the failure of the original commit with address sanitizer.

7 years agolocale.c: Silence HP-UX compiler warning
Karl Williamson [Thu, 3 Mar 2016 16:14:13 +0000 (09:14 -0700)]
locale.c: Silence HP-UX compiler warning

Cast this flag value to a bool, which is what we want anyway here.

7 years agoWarn of the "else syndrome".
Jarkko Hietaniemi [Thu, 3 Mar 2016 14:01:05 +0000 (09:01 -0500)]
Warn of the "else syndrome".

Not that anyone ever reads perlport.

7 years agoClarify what AmigaOS version was broken by 5.8.0
Jarkko Hietaniemi [Thu, 3 Mar 2016 13:57:32 +0000 (08:57 -0500)]
Clarify what AmigaOS version was broken by 5.8.0

7 years agoperl5db.pl version bump
Jarkko Hietaniemi [Thu, 3 Mar 2016 01:11:23 +0000 (20:11 -0500)]
perl5db.pl version bump

7 years agoDefaulting to VMS is probably not right.
Jarkko Hietaniemi [Wed, 2 Mar 2016 23:49:18 +0000 (18:49 -0500)]
Defaulting to VMS is probably not right.

7 years agoamigaos4: use CONSOLE:, not VMS sys$command
Andy Broad [Wed, 2 Mar 2016 23:45:52 +0000 (18:45 -0500)]
amigaos4: use CONSOLE:, not VMS sys$command

7 years agoamigaos4: clean up older style / deprecated AmigaOS calls
Andy Broad [Wed, 2 Mar 2016 23:43:44 +0000 (18:43 -0500)]
amigaos4: clean up older style / deprecated AmigaOS calls

7 years agoreduce number of calls to add_cp_to_invlist()
Tony Cook [Wed, 2 Mar 2016 05:19:43 +0000 (16:19 +1100)]
reduce number of calls to add_cp_to_invlist()

Both S_get_ANYOF_cp_list_for_ssc() and S_put_charclass_bitmap_innards()
have tight loops that iterate over a bitmap and calls add_cp_to_invlist()
for each bit set.

add_cp_to_invlist() is a fairly wrapper around _add_range_to_invlist()
which create a new invlist to hold the range and then calls
_invlist_union() to perform the add.  This is moderately expensive.

Instead of indirectly calling _add_range_to_invlist(), where it's
simple to do so, instead look for ranges of bits set in the bitmaps
and call _add_range_to_invlist() directly.

This changed the cachegrind output from running:

  ./perl -e 'qr/_?[\W_]/;'

from:

==23406== I   refs:      1,752,149
==23406== I1  misses:        5,405
==23406== LLi misses:        3,588
==23406== I1  miss rate:      0.30%
==23406== LLi miss rate:      0.20%
==23406==
==23406== D   refs:        683,242  (414,061 rd   + 269,181 wr)
==23406== D1  misses:       13,370  (  7,646 rd   +   5,724 wr)
==23406== LLd misses:        7,025  (  3,417 rd   +   3,608 wr)
==23406== D1  miss rate:       1.9% (    1.8%     +     2.1%  )
==23406== LLd miss rate:       1.0% (    0.8%     +     1.3%  )
==23406==
==23406== LL refs:          18,775  ( 13,051 rd   +   5,724 wr)
==23406== LL misses:        10,613  (  7,005 rd   +   3,608 wr)
==23406== LL miss rate:        0.4% (    0.3%     +     1.3%  )

to:

==25041== I   refs:      1,189,412
==25041== I1  misses:        5,218
==25041== LLi misses:        3,598
==25041== I1  miss rate:      0.43%
==25041== LLi miss rate:      0.30%
==25041==
==25041== D   refs:        440,339  (283,047 rd   + 157,292 wr)
==25041== D1  misses:       11,872  (  7,257 rd   +   4,615 wr)
==25041== LLd misses:        7,024  (  3,417 rd   +   3,607 wr)
==25041== D1  miss rate:       2.6% (    2.5%     +     2.9%  )
==25041== LLd miss rate:       1.5% (    1.2%     +     2.2%  )
==25041==
==25041== LL refs:          17,090  ( 12,475 rd   +   4,615 wr)
==25041== LL misses:        10,622  (  7,015 rd   +   3,607 wr)
==25041== LL miss rate:        0.6% (    0.4%     +     2.2%  )

ie. from 1.75 million instructions to 1.19 million instructions.

7 years agoPATCH: [perl #127599] Fix regcomp.c assertion
Karl Williamson [Wed, 2 Mar 2016 17:50:01 +0000 (10:50 -0700)]
PATCH: [perl #127599] Fix regcomp.c assertion

I added this assertion in cfbef7dc3.  It asserts that we have more to
parse.  The code in this function is quite complicated, and assumes in a
number of places that there is more to parse.  When we don't have more
to parse, 900 lines later, it throws an error.  It may be that you can't
get to the places where it assumes there is more to parse if this
assertion is false (I don't remember now from my tedious audit of this
code), but even if so, it is fragile to assume so, given the large
distance to where the error is thrown.  So throw the error right away
and avoid any existing or future breakage.

7 years agodocument args of Perl_do_sv_dump()
David Mitchell [Wed, 2 Mar 2016 17:29:31 +0000 (17:29 +0000)]
document args of Perl_do_sv_dump()

7 years agoamigaos4: no sigaction, no si fields
Jarkko Hietaniemi [Wed, 2 Mar 2016 00:56:04 +0000 (19:56 -0500)]
amigaos4: no sigaction, no si fields

7 years agopp_subst(): rename local var
David Mitchell [Wed, 2 Mar 2016 11:23:54 +0000 (11:23 +0000)]
pp_subst(): rename local var

make it clear that is_cow represents the original COW state (which may not
be the current state when checked later), by renaming it to was_cow.

7 years agopp_subst: fix typo
David Mitchell [Wed, 2 Mar 2016 10:25:32 +0000 (10:25 +0000)]
pp_subst: fix typo

7 years agouse cBOOL() in pp_subst()
David Mitchell [Wed, 2 Mar 2016 10:23:43 +0000 (10:23 +0000)]
use cBOOL() in pp_subst()

Now that we have that macro, use it.

7 years agoS_regmatch(): remove dead code
David Mitchell [Wed, 2 Mar 2016 09:16:34 +0000 (09:16 +0000)]
S_regmatch(): remove dead code

The 'sayNO'; follows a croak, so can never be reached.

7 years agoremove some duplicate /* NOTREACHED */
David Mitchell [Wed, 2 Mar 2016 09:08:48 +0000 (09:08 +0000)]
remove some duplicate /* NOTREACHED */

In regexec.c there were several occurrences of

    /* NOTREACHED */
    NOT_REACHED; /* NOTREACHED */

where the first line isn't needed.

7 years agoRevert "PATCH: {perl #127582] Over eager warning for /[.foo.]/"
Karl Williamson [Wed, 2 Mar 2016 05:42:46 +0000 (22:42 -0700)]
Revert "PATCH: {perl #127582] Over eager warning for /[.foo.]/"

This reverts commit a9149dfda17b511d34bb2af869948b677be52fbc.
This is causing failures in blead under clang, so I'm reverting it until
I can work out why.

7 years agoRevert "regcomp.c: White-space only"
Karl Williamson [Wed, 2 Mar 2016 05:41:59 +0000 (22:41 -0700)]
Revert "regcomp.c: White-space only"

This reverts commit 7511771ceb229ce97939f643c6de73c6b1a371be, so that
the next commit can be cleanly reverted

7 years agobump $strict::VERSION and $warnings::VERSION
Tony Cook [Wed, 2 Mar 2016 04:52:06 +0000 (15:52 +1100)]
bump $strict::VERSION and $warnings::VERSION

7 years agonarrow the filename check in strict.pm/warnings.pm
Aristotle Pagaltzis [Wed, 2 Mar 2016 02:30:30 +0000 (03:30 +0100)]
narrow the filename check in strict.pm/warnings.pm

• The code previously assumed that any filename basename besides
  `strict.pm` meant that the user mistyped `use strict` (e.g. as
  `use Strict`). But that could just mean the file was not loaded
  from the filesystem, e.g. due to naïve fatpacking.

  This is fixed by adding a guard to check that an unexpected value
  really is a mis-capitalised variant of `strict.pm`.

• The code previously insisted on either slash or backslash as the
  directory separator, which is not strictly portable (though nobody
  noticed in years; apparently nobody has tried to run a recent-ish
  on a MacOS Classic or RiscOS system).

  This is fixed by switching to \b as a best effort, to avoid going
  down the rabbit hole of platform-specific separators.

• The code previously used an `unless` statement, declared lexical
  variables inside its block, and used ${\EXPR} to interpolate the
  __PACKAGE__ constant into the regexp. Each of these increases the
  size of the optree, which is only ever executed once, then sticks
  around wasting some hundred(s) bytes in almost every single Perl
  program in the world.

  This is fixed for warnings.pm by rewriting the code with no use of
  any temporary variables and single-quoted strings instead of regexp
  literals. In strict.pm, we can do even better by moving the code to
  the BEGIN block, since BEGIN CVs are freed after running. (We do not
  add one to warnings.pm since BEGIN blocks have a creation cost.)

7 years agoregcomp.c: Avoid an empty [] in -Dr output
Karl Williamson [Tue, 1 Mar 2016 22:19:49 +0000 (15:19 -0700)]
regcomp.c: Avoid an empty [] in -Dr output

7 years agoregcomp.c: White-space only
Karl Williamson [Tue, 1 Mar 2016 18:26:49 +0000 (11:26 -0700)]
regcomp.c: White-space only

Outdent and reflow comments because the previous commit removed a
surrounding block.

7 years agoPATCH: {perl #127582] Over eager warning for /[.foo.]/
Karl Williamson [Tue, 1 Mar 2016 18:03:04 +0000 (11:03 -0700)]
PATCH: {perl #127582] Over eager warning for /[.foo.]/

This fixes the issue by severely restricting what we recognize as the
interior of the [. .] and [= =] constructs, as suggested by Tony Cook.

I find the POSIX documentation very unclear, but it appears to me that
just about anything can be in the interior, and that is how I originally
wrote the code, and which led to this bug.  But weird interiors would
only arise with really weird locales and only when the pattern is being
compiled under locale qr//l rules.  A portable pattern would use the
restricted interior characters that this commit adopts.

7 years agoregexec.c: Fix failure to match problem
Karl Williamson [Tue, 1 Mar 2016 20:07:45 +0000 (13:07 -0700)]
regexec.c: Fix failure to match problem

This bug has shown up only under EBCDIC so far, but could affect other
code.

Commit dcf88e3433dcd5bc25811f9769e82d04c61a1d5a fixed a bug in which a
macro parameter needed to be dereferenced.  Until then, the failure to
dereference meant some code that turned out to be faulty, was
effectively always skipped.  So that commit, while correct in and of
itself, exposed a pre-existing bug.

It was hard for me to believe at first that a change of simply adding a
missing '*' could have broken things this way.  But the clue was that
the only characters that were affected were the set of C1 controls, and
only when the target matched string was in UTF-8, and only on EBCDIC
systems.  The difference between EBCDIC and ASCII platforms in this
regard is that the C1 controls under UTF-8 are represented by a single
byte on EBCDIC systems, and two bytes on ASCII.  The test that adding
the dereference to is looking for characters that are single bytes under
both UTF-8 and not, and hence would give different results on EBCDIC and
ASCII platforms for exactly the set of C1 controls.

The code in question looks up an input code point to see if it is
matched by an ANYOF node, the kind generated for bracketed character
classes.  The first N code points are stored in a bit vector.  (N is
generally 256, but perl can be compiled to make that larger.)  If there
are no complications, the answer can be found directly by just looking
up the code point in the vector.  But if there are complications, a
function is called to sort them all out.  The macro looks for
complications, and calls the function if needed, but does the lookup
directly if not.  One of those complications is that the input needs to
be decoded to its actual code point value if the target is UTF-8 and the
code point isn't a single byte then.  After the dereference fix, the
caller of the macro knew correctly that this was a single byte, and so
was calling the macro,  But it turns out that the macro, as commented,
was expecting to be called only if the target was not-UTF-8, and so
unconditionally said to the function that it wasn't UTF-8, and so the
function didn't work properly.

The solution is to simply call the function in the macros with the
correct value of whether the target string is UTF-8 or not.

7 years agoembed.fnc: Fcn should have been within an #ifdef
Karl Williamson [Tue, 1 Mar 2016 01:57:18 +0000 (18:57 -0700)]
embed.fnc: Fcn should have been within an #ifdef

7 years agoPATCH: [perl #127581] Spurious warning about posix class
Karl Williamson [Tue, 1 Mar 2016 01:39:20 +0000 (18:39 -0700)]
PATCH: [perl #127581] Spurious warning about posix class

7 years agoregcomp.c: revise comments, white-space
Karl Williamson [Sun, 28 Feb 2016 16:53:09 +0000 (09:53 -0700)]
regcomp.c: revise comments, white-space

7 years agoinstallman: don't warn about missing pod
David Mitchell [Tue, 1 Mar 2016 16:04:36 +0000 (16:04 +0000)]
installman: don't warn about missing pod

Currently it spits out about 80 lines like the following to stderr:

    no documentation in lib/Archive/Tar/Constant.pm
    no documentation in lib/CPAN/Author.pm
    no documentation in lib/CPAN/Bundle.pm

Since this is not actually an error condition, spit to stdout instead,
and only under --verbose.

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

7 years agoVMS patch for duplicate env entries
Craig A. Berry [Sat, 13 Feb 2016 14:12:01 +0000 (09:12 -0500)]
VMS patch for duplicate env entries

7 years agoremove duplicate environment variables from environ
Tony Cook [Wed, 27 Jan 2016 00:52:15 +0000 (11:52 +1100)]
remove duplicate environment variables from environ

If we see duplicate environment variables while iterating over
environ[]:

a) make sure we use the same value in %ENV that getenv() returns.

Previously on a duplicate, %ENV would have the last entry for the name
from environ[], but a typical getenv() would return the first entry.

Rather than assuming all getenv() implementations return the first entry
explicitly call getenv() to ensure they agree.

b) remove duplicate entries from environ

Previously if there was a duplicate definition for a name in environ[]
setting that name in %ENV could result in an unsafe value being passed
to a child process, so ensure environ[] has no duplicates.

CVE-2016-2381

7 years agoperldelta: Fix typo
Karl Williamson [Tue, 1 Mar 2016 04:12:59 +0000 (21:12 -0700)]
perldelta: Fix typo

Spotted by Andrew Rodland

7 years agore/regexp_unicode_prop.t: Fix loop statement
Karl Williamson [Tue, 1 Mar 2016 04:12:59 +0000 (21:12 -0700)]
re/regexp_unicode_prop.t: Fix loop statement

This was doing an extra shift, which doesn't matter currently because
there's only one element in the array, but could cause future problems.

7 years agoregexp_unicode_prop.t: Clarify comment
Karl Williamson [Tue, 1 Mar 2016 04:12:12 +0000 (21:12 -0700)]
regexp_unicode_prop.t: Clarify comment

7 years agoFix /\p{pkg::User-defined}/i
Karl Williamson [Mon, 15 Feb 2016 18:25:35 +0000 (11:25 -0700)]
Fix /\p{pkg::User-defined}/i

Prior to this commit, the parsing code got confused if a user-defined
property whose definition was not known at pattern compilation time, was
specified with an explicit package name, under /i.

7 years ago[perl #127635] s///r with -DPERL_NO_COW attempts to modify source SV
Tony Cook [Mon, 29 Feb 2016 23:41:46 +0000 (10:41 +1100)]
[perl #127635] s///r with -DPERL_NO_COW attempts to modify source SV

based on work done by bulk88, per his notes below:

I found pp_subst with a -DPERL_NO_COW build on an experimental perl branch
would die in ../dist/SelfLoader/t/03taint.t in this line
"my $file = __FILE__ =~ s/[\w.]+\z/01SelfLoader.t/r;" with a attempt to
modify since sv_force_normal_flags checks for readonlyness. The
-DPERL_NO_COW exclusive logic seems faulty, since the COW branch right
above stores the cow status and doesn't call sv_force_normal_flags until
it actually wants to modify the source SV, and pp_subst wont modify the
source SV if PMf_NONDESTRUCT is on.

So fix the die by only de-COWing if !PMf_NONDESTRUCT. Do not deCOW the
source SV if PMf_NONDESTRUCT. The
"my $file = __FILE__ =~ s/[\w.]+\z/01SelfLoader.t/r;" fatal die can not be
reproduced in blead perl with -DPERL_NO_COW, only in my experimental branch
so I rewrote the test to use a const sub that is folded to a
HEK COW RO SV * instead of the __FILE__ token which is not a HEK COW on
blead perl. The subst.t test only fails if perl is compiled with
-DPERL_NO_COW. To avoid an extra !(rpm->op_pmflags & PMf_NONDESTRUCT) check
on a NO_COW build, restructure the logic so
!(rpm->op_pmflags & PMf_NONDESTRUCT) is tested only once. Filed as
[perl #127635].

7 years agoScalar-List-Utils customization bump
Jarkko Hietaniemi [Mon, 29 Feb 2016 13:47:54 +0000 (08:47 -0500)]
Scalar-List-Utils customization bump

7 years agoScalar-List-Utils version bump
Jarkko Hietaniemi [Mon, 29 Feb 2016 13:43:51 +0000 (08:43 -0500)]
Scalar-List-Utils version bump

7 years agoproduct() with zero IV crash/hang
Jarkko Hietaniemi [Mon, 29 Feb 2016 13:39:02 +0000 (08:39 -0500)]
product() with zero IV crash/hang

CID 104785: Division or modulo by zero (DIVIDE_BY_ZERO)
238. divide_by_zero: In expression 9223372036854775807L / retiv, division by expression retiv which may be zero has undefined behavior.
215                if(!SvNOK(sv) && SvIOK(sv) && (SvIV(sv) < IV_MAX / retiv)) {

Cherry-pick of the changes in
https://rt.cpan.org/Public/Bug/Display.html?id=105415

7 years agoSocket customization bump
Jarkko Hietaniemi [Mon, 29 Feb 2016 12:16:59 +0000 (07:16 -0500)]
Socket customization bump

7 years agoSocket version bump
Jarkko Hietaniemi [Mon, 29 Feb 2016 12:15:08 +0000 (07:15 -0500)]
Socket version bump

7 years agoCheck for max length before derefing by length.
Jarkko Hietaniemi [Mon, 29 Feb 2016 11:50:58 +0000 (06:50 -0500)]
Check for max length before derefing by length.

Coverity CID 135025 (#1 of 1): Out-of-bounds read (OVERRUN)
29. overrun-local: Overrunning array addr.sun_path of 108 bytes at byte offset 108 using index addr_len (which evaluates to 108).
 864                for (addr_len = 0; addr.sun_path[addr_len]
 28. incr: Incrementing addr_len. The value of addr_len may now be up to 108.
 865                     && addr_len < maxlen; addr_len++);

Reported upstream as

https://rt.cpan.org/Ticket/Display.html?id=111707

7 years agoteach makedef.pl an alternate macro for PERL_COPY_ON_WRITE
Daniel Dragan [Mon, 29 Feb 2016 03:44:18 +0000 (22:44 -0500)]
teach makedef.pl an alternate macro for PERL_COPY_ON_WRITE

otherwise a -DPERL_NO_COW perl win32 build fails during linking perl523.dll
with missing Perl_sv_setsv_cow

7 years agoperlport: use italics instead of colon in "don't":s (RT #127627)
Lukas Mai [Sun, 28 Feb 2016 22:10:50 +0000 (23:10 +0100)]
perlport: use italics instead of colon in "don't":s (RT #127627)

7 years agoImprove wording of perldelta entry for ae146f5496e
Dagfinn Ilmari Mannsåker [Mon, 29 Feb 2016 13:55:41 +0000 (13:55 +0000)]
Improve wording of perldelta entry for ae146f5496e

7 years agoAdjust callsites that use UTF8SKIP without checking UTF
Alex Vandiver [Mon, 23 Mar 2015 03:44:11 +0000 (23:44 -0400)]
Adjust callsites that use UTF8SKIP without checking UTF

Assuming UTF-8 semantics and advancing character-by-character when 'use
utf8' is not enabled is not as problematic as the inverse.  However,
properly UTF8SKIP should only be used when UTF8 semantics are explicitly
asked for.

Change the three occurrences of UTF8SKIP that are not protected by UTF
checks.

7 years agoperldelta for ae146f5496e
Tony Cook [Sun, 28 Feb 2016 22:59:16 +0000 (09:59 +1100)]
perldelta for ae146f5496e

7 years ago[perl #127584] using Win32 32b gmake with 64b gcc caused wrong archname
Daniel Dragan [Sun, 28 Feb 2016 22:52:56 +0000 (09:52 +1100)]
[perl #127584] using Win32 32b gmake with 64b gcc caused wrong archname

Using a 32 bit Win32 gmake, with a GCC that produces 64 bit binaries, made
a perl with PTRSIZE 64 bits, and 64 bit machine code, but archname IDed
that build as "x86" not "x64", which is very wrong. Perl's
win32/GNUMakefile autodetects the bitness of the GCC and sets things up
accordingly. Fixes [perl #127584]. This bug might be a regression
introduced in commit 745dedb9b5 or the GNUMakefile parallel build branch.

7 years agoUpgrade to IPC-SysV 2.06.
Jarkko Hietaniemi [Sun, 28 Feb 2016 22:35:33 +0000 (17:35 -0500)]
Upgrade to IPC-SysV 2.06.

Fixing an oopsie of yours truly from 2.05.

7 years agostatic funcs in HiRes.xs
Daniel Dragan [Fri, 26 Feb 2016 20:35:28 +0000 (15:35 -0500)]
static funcs in HiRes.xs

Less indirection on ELF.

7 years ago[perl #127624] corelist: wrong Digest::SHA version in 5.18.4
Chris 'BinGOs' Williams [Sun, 28 Feb 2016 15:53:56 +0000 (15:53 +0000)]
[perl #127624] corelist: wrong Digest::SHA version in 5.18.4

A bit of sleuthing showed that it was actually version bumped for
the v5.18.3 release.

Also noticed that Config hadn't been updated as well, sorted that
out too.

7 years agoregcomp.c: Use less peak memory
Karl Williamson [Sat, 27 Feb 2016 22:07:09 +0000 (15:07 -0700)]
regcomp.c: Use less peak memory

This continues the process started in
accb4364d92e26c20e6a538fc04d1af52a8b94e2 of lowering memory use by not
creating unnecessary mortal SVs.

This changes the inversion union and intersection functions to avoid
entirely the creation of new mortals.

7 years agoregcomp.c: Modify an assert
Karl Williamson [Sat, 27 Feb 2016 22:05:09 +0000 (15:05 -0700)]
regcomp.c: Modify an assert

This newly-added assert could fail, but hasn't so far.  Fix it.

7 years agoregcomp.c: Avoid an unnecessary mortal SV
Karl Williamson [Sat, 27 Feb 2016 22:01:43 +0000 (15:01 -0700)]
regcomp.c: Avoid an unnecessary mortal SV

In some paths,  an SV was created mortal, and immediately thrown away.

7 years agoregcomp.c: Improve free-ing up unused inversion list space
Karl Williamson [Sat, 27 Feb 2016 21:59:47 +0000 (14:59 -0700)]
regcomp.c: Improve free-ing up unused inversion list space

The invlist_trim() function wasn't freeing up space if the new space
needed was small.  This now frees up all but the required minimum.

7 years agoregcomp.c: Add new static inline convenience function
Karl Williamson [Sat, 27 Feb 2016 20:54:51 +0000 (13:54 -0700)]
regcomp.c: Add new static inline convenience function

7 years agoregcomp.c: Change variable names, white-space
Karl Williamson [Wed, 24 Feb 2016 17:06:34 +0000 (10:06 -0700)]
regcomp.c: Change variable names, white-space

A future commit will make more sense if these names are changed.  This
reindents some code so that it  doesn't overflow 79 columns

7 years agoregcomp.c: Change name of static function
Karl Williamson [Sat, 27 Feb 2016 19:36:37 +0000 (12:36 -0700)]
regcomp.c: Change name of static function

I found myself using this function, forgetting that it zapped one of the
parameters, so change the name so that can't be forgotten.

7 years agoperlfunc overhaul
Lukas Mai [Sat, 27 Feb 2016 04:17:57 +0000 (05:17 +0100)]
perlfunc overhaul

- remove trailing whitespace
- consistently refer to builtins as C<foo>, not foo() or C<foo()>
- hyperlink each C<foo> builtin to its section in perlfunc
- replace some occurrences of -w with a reference to the warnings pragma
- refer to listy comma as "list concatenation" because that's what it
  does
- consistently hyperlink references to external programs (L<touch(1)>),
  system calls (L<fork(2)>), and library functions (L<fdopen(3)>)
- hyperlink variables to their section in perlvar
- hyperlink the names of modules/pragmas
- hyperlink names of functions provided by modules (where possible)
- consistently use "pragmas", not "pragmata" (there were only two of
  those)
- use the same wording for all conditional builtins / features
- -T and -B are file tests, not switches
- remove "see L</open>" (regarding the ':encoding' layer) from
  description of binmode because I don't see why it was there
- refer to variables as C<$foo>, not $foo
- hyperlink some error messages to perldiag
- remove & from subroutine calls
- grammar: write "if X, Y" with a comma and "Y if X" without
- use 'my' in examples when introducing new variables
- 'while (', not 'while('
- don't capitalize the next word after a semicolon
- consistently start error messages (die/warn) with "Can't" (not
  "can't", "Cannot", or "cannot")
- replace bareword filehandles by normal variables in examples
- add missing ')'
- fix module names: IPC::SysV::Msg -> IPC::Msg, IPC::SysV::Semaphore ->
  IPC::Semaphore
- 'open': replace note about binmode with equivalent paragraph from
  'binmode' (the one in 'open' claimed unix systems don't need binmode,
  which is not true with encodings)
- 'open': delete overly clever example of generating filehandle names in
  a recursive function (this is a non-issue with lexical filehandles)
- 'open': instead of running 'perl -V' and looking for the useperlio
  line, you can just run 'perl -V:useperlio'
- 'open': mention shell feature of 'yourscript.pl <( other command )',
  which makes the only remaining use of 2-arg open redundant
- 'open': sysopen uses different modes than open; they're not "subtly
  different" and there's no "may" about it
- 'open': use $fh->autoflush(1) instead of select/$| dance (especially
  since the example already loads IO::Handle for no reason)
- 'printf': remove garbled text ("Look for this throught pod")
- change "use locale 'not_characters'" to the correct "use locale
  ':not_characters'"
- (hopefully) fix inconsistent use of "real filehandle"; use "bareword
  filehandle" instead to distinguish from scalar variables / globrefs
- ":encoding" is a layer, not a pragma
- 'readline': actually use readline in examples
- ?...? is no longer valid; use m?...? instead
- 'sort': whether the algorithm is stable has no effect on runtime
  complexity, so "That algorithm was not stable, so I<could> go
  quadratic" is nonsense
- 'sort': declaring $a/$b as lexicals is an error regardless of strict
- 'sysopen': as far as I can tell the note about depending on fdopen()
  is only true for non-PerlIO builds
- 'use': add an example of what 'use Module VERSION' expands to
- add 'select FILEHANDLE' to filehandle related functions

Also touch ext/Pod-Functions/Functions_pm.PL to make it parse
L<C<foo>|...> in the overview paragraphs.

And teach t/porting/podcheck.t about a ton of man pages and some
external modules.

7 years agoregcomp.c: Add missing 'STATIC'
Karl Williamson [Fri, 26 Feb 2016 23:41:11 +0000 (16:41 -0700)]
regcomp.c: Add missing 'STATIC'

7 years agoFix regex failures on big-endian systems
Karl Williamson [Fri, 26 Feb 2016 20:57:10 +0000 (13:57 -0700)]
Fix regex failures on big-endian systems

Commit accb4364d92e26c20e6a538fc04d1af52a8b94e2 caused regexes to fail
on big-endian systems.  It was because I used SvCUR where I should have
been using SvLEN, and was overwriting the final byte of real data with
0, which didn't matter as long as that byte was 0, which in our smokes
on litlle-endian systems, it was.

Further clarification is that inversion lists are stored as UV*, whereas
the scalar handling code is expecting char*.  By casting, it all works
out, except that the final byte is kept as a single char NUL.  I was
trying to write that final byte as a byte, but by using SvCUR, I was
getting a byte in one of the UVs.  With small numbers on a little-endian
system, that byte will be 0 anyway, but not on a big-endian one.

7 years agoperlvar: hyperlink from $^D to perlrun/-D
Lukas Mai [Wed, 24 Feb 2016 23:59:41 +0000 (00:59 +0100)]
perlvar: hyperlink from $^D to perlrun/-D

7 years agopodcheck.t: expand POD sequences in L</...> section names
Lukas Mai [Thu, 25 Feb 2016 02:48:48 +0000 (03:48 +0100)]
podcheck.t: expand POD sequences in L</...> section names

7 years agoFix perldoc -f sleep to use $SIG{ALRM} instead of $SIG{ALARM}.
Matthew Horsfall [Wed, 24 Feb 2016 20:06:38 +0000 (15:06 -0500)]
Fix perldoc -f sleep to use $SIG{ALRM} instead of $SIG{ALARM}.

7 years agoUse less memory in compiling regexes
Karl Williamson [Tue, 23 Feb 2016 21:04:19 +0000 (14:04 -0700)]
Use less memory in compiling regexes

This is at least a partial patch for [perl #127392], cutting the maximum
memory used on my box from around 8600kB to 7800kB.  For [perl #127568],
which has been merged into #127392, the savings are even larger, about
37%

Previously a large number of large mortal SVs could be created while
compiling a single regex pattern, and their accumulated memory quickly
added up.  This changes things to not use so many mortals.

7 years agoregcomp.c: Guard against corrupting inversion list SV
Karl Williamson [Tue, 23 Feb 2016 21:00:23 +0000 (14:00 -0700)]
regcomp.c: Guard against corrupting inversion list SV

I don't know of any cases where this happens, but in working on the next
commit I triggered a problem with shrinking an inversion list so much
that the required 0 UV at the beginning was freed.

7 years agosilence warning in Win32CORE
Daniel Dragan [Sun, 21 Feb 2016 17:28:14 +0000 (12:28 -0500)]
silence warning in Win32CORE

Win32CORE.c: In function ‘boot_Win32CORE’:
../../XSUB.h:127:43: warning: unused parameter ‘cv’ [-Wunused-parameter]

7 years ago[perl #127386] clarify that exit in the die pseudo-code is perl's exit
Tony Cook [Tue, 23 Feb 2016 04:09:39 +0000 (15:09 +1100)]
[perl #127386] clarify that exit in the die pseudo-code is perl's exit

7 years agoM-CL sync with what tis is on CPAN
Chris 'BinGOs' Williams [Tue, 23 Feb 2016 00:44:08 +0000 (00:44 +0000)]
M-CL sync with what tis is on CPAN

7 years agorelease schedule: Sawyer to release October 2016
Ricardo Signes [Sun, 21 Feb 2016 21:59:17 +0000 (08:59 +1100)]
release schedule: Sawyer to release October 2016

7 years agoMerge branch 'blead' of ssh://perl5.git.perl.org/perl into blead
Sawyer X [Sun, 21 Feb 2016 16:51:25 +0000 (17:51 +0100)]
Merge branch 'blead' of ssh://perl5.git.perl.org/perl into blead

7 years agoMore updates to Module::CoreList:
Sawyer X [Sun, 21 Feb 2016 13:02:27 +0000 (14:02 +0100)]
More updates to Module::CoreList:

I hope I got this right (I probably didn't though). The release
version was 20160121, not 20160220 or 20160221, so I'm not really
sure what's going on. Of course, with Module::CoreList I'm rarely
sure.

Still all tests pass and the world hasn't exploded yet, as far
as I know.

If you find a problem with this, I would appreciate a fix, but
also to ping me and tell me what I did wrong. I promise to update
the release checklist with it.

Thanks!

7 years agoupdate Module::CoreList and bump version
Sawyer X [Sun, 21 Feb 2016 12:36:10 +0000 (13:36 +0100)]
update Module::CoreList and bump version

7 years agot/re/pat_advanced.t: Test for [#perl 126886]
Karl Williamson [Sun, 21 Feb 2016 01:29:25 +0000 (18:29 -0700)]
t/re/pat_advanced.t: Test for [#perl 126886]

This was fixed by cfbef7dc3bfb89e4ed2c00ea9c9e3bcfd0b170fd

7 years agobump version to 5.23.9
Sawyer X [Sat, 20 Feb 2016 22:51:37 +0000 (23:51 +0100)]
bump version to 5.23.9

7 years agonew perldelta for 5.23.9
Sawyer X [Sat, 20 Feb 2016 22:39:02 +0000 (23:39 +0100)]
new perldelta for 5.23.9

7 years agoupdate 5.23.8 as done on release schedule
Sawyer X [Sat, 20 Feb 2016 22:21:58 +0000 (23:21 +0100)]
update 5.23.8 as done on release schedule

7 years agoadd 5.23.8 epigraph
Sawyer X [Sat, 20 Feb 2016 22:21:11 +0000 (23:21 +0100)]
add 5.23.8 epigraph

7 years agoMerge branch 'release-5.23.8' into blead
Sawyer X [Sat, 20 Feb 2016 22:17:07 +0000 (23:17 +0100)]
Merge branch 'release-5.23.8' into blead

7 years agoadd new release to perlhist v5.23.8
Sawyer X [Sat, 20 Feb 2016 20:09:58 +0000 (21:09 +0100)]
add new release to perlhist

7 years agoTypos, POD errors, etc. origin/release-5.23.8
Sawyer X [Sat, 20 Feb 2016 19:46:45 +0000 (20:46 +0100)]
Typos, POD errors, etc.

7 years agoUpdate perldelta module versions (Porting/corelist-perldelta.pl)
Sawyer X [Sat, 20 Feb 2016 19:22:02 +0000 (20:22 +0100)]
Update perldelta module versions (Porting/corelist-perldelta.pl)

7 years agoupdate Module::CoreList (Porting/corelist.pl)
Sawyer X [Sat, 20 Feb 2016 18:52:03 +0000 (19:52 +0100)]
update Module::CoreList (Porting/corelist.pl)

7 years agocleanup perldelta
Sawyer X [Sat, 20 Feb 2016 17:22:33 +0000 (18:22 +0100)]
cleanup perldelta