This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perl5.git
6 years agoregen/mk_invlists.pl: Outdent code
Karl Williamson [Sat, 16 Dec 2017 18:48:12 +0000 (11:48 -0700)]
regen/mk_invlists.pl: Outdent code

This was unnecessarily indented.  This commit also removes an
unnecessary {...} block, and outdents the interior as well.
No other changes are made

6 years agoregen/mk_invlists.pl: Fix typo
Karl Williamson [Sat, 16 Dec 2017 18:37:21 +0000 (11:37 -0700)]
regen/mk_invlists.pl: Fix typo

6 years agoperlre: '#' is a metacharacter under /x
Karl Williamson [Sun, 17 Dec 2017 00:05:50 +0000 (17:05 -0700)]
perlre: '#' is a metacharacter under /x

6 years agomake dNOOP usable outside function in C++
Zefram [Sat, 16 Dec 2017 22:46:33 +0000 (22:46 +0000)]
make dNOOP usable outside function in C++

Commit 7db66e12883f0832ca80164b723768b848187bda changed dNOOP in C++ from
an external function declaration (which was running into inconsistent
linkage) to a no-op statement.  The no-op statement is only valid where
statements are valid, i.e., inside a function, so this doesn't actually
work everywhere that a declaration is expected.

Switch dNOOP to be an incomplete struct declaration, regardless of
language.  This can certainly be used both inside and outside functions,
is valid to repeat, and does not have the linkage problem of a function
declaration.  It should also be as unlikely to attract an "unused"
warning as an external function declaration.

6 years agotypo fix in doc
Zefram [Sat, 16 Dec 2017 09:30:16 +0000 (09:30 +0000)]
typo fix in doc

6 years agoshow modern usage for {XS,Dyna}Loader
Zefram [Sat, 16 Dec 2017 08:34:25 +0000 (08:34 +0000)]
show modern usage for {XS,Dyna}Loader

Fixes [perl #132247].

6 years agosemicolon-friendly diagnostic control
Zefram [Sat, 16 Dec 2017 07:12:48 +0000 (07:12 +0000)]
semicolon-friendly diagnostic control

New macros {GCC,CLANG}_DIAG_{IGNORE,RESTORE}_{DECL,STMT}, which take a
following semicolon.  It is necessary to use the _DECL or _STMT version
as appropriate to the context.  Fixes [perl #130726].

6 years agoperform system() arg processing before fork
Zefram [Sat, 16 Dec 2017 05:33:20 +0000 (05:33 +0000)]
perform system() arg processing before fork

A lot of things can happen when stringifying an argument list: side
effects, warnings, exceptions.  In the case of system(), these effects
should happen in the context of the parent process.  The stringification
can also depend on which process it happens in, as in the case of
$$, and in that case it should also happen in the parent process.
Therefore reduce the argument scalars to strings first thing in pp_system.
Fixes [perl #121105].

6 years agoupdate and clarify "die" and "warn" doc
Zefram [Sat, 16 Dec 2017 04:47:08 +0000 (04:47 +0000)]
update and clarify "die" and "warn" doc

They didn't fully describe the handling of reference operands, and
there were other errors in their description of the treatment of the
operand list.  Fixes [perl #121372].

6 years agoretry gdbm_open() upon block size error
Zefram [Sat, 16 Dec 2017 02:17:08 +0000 (02:17 +0000)]
retry gdbm_open() upon block size error

It is reported that gdbm_open() with default block size can fail on
filesystems with a non-power-of-two block size.  In that event, retry
opening, forcing a power-of-two block size.  Fixes [perl #119623].

6 years agoadd ticket number to perldelta entry
Zefram [Sat, 16 Dec 2017 01:48:22 +0000 (01:48 +0000)]
add ticket number to perldelta entry

6 years agowiden size-type variables in pack/unpack
Zefram [Sat, 16 Dec 2017 01:44:32 +0000 (01:44 +0000)]
widen size-type variables in pack/unpack

Most size-type variables in pp_pack.c were of type I32, with a
smattering of other types.  Use SSize_t in place of I32, and generally
use size_t-width variables as appropriate.  Fixes [perl #119367].

6 years agoperlfunc: remove stray plus from start of line
Marco Fontani [Fri, 15 Dec 2017 17:16:31 +0000 (10:16 -0700)]
perlfunc: remove stray plus from start of line

 Looks to be an artifact of applying my original patch, which was
 amended as part of e135ff695231a81e2a70a739e8d813525432fd4d, whereby
 the text was slightly amended.

6 years agodocument GDBM_File's delete vs each conflict
Zefram [Fri, 15 Dec 2017 09:51:33 +0000 (09:51 +0000)]
document GDBM_File's delete vs each conflict

Fixes [perl #117449].

6 years agorewrite "ref" documentation for clarity
Zefram [Fri, 15 Dec 2017 07:00:11 +0000 (07:00 +0000)]
rewrite "ref" documentation for clarity

6 years agoclean up directories of split pod files
Zefram [Fri, 15 Dec 2017 05:12:32 +0000 (05:12 +0000)]
clean up directories of split pod files

Fixes [perl #114316].

6 years agoperldelta 282fc0b3cc2439f69587d980b62bef7f5d5bdfef
Zefram [Fri, 15 Dec 2017 02:14:25 +0000 (02:14 +0000)]
perldelta 282fc0b3cc2439f69587d980b62bef7f5d5bdfef

6 years agoperldelta e135ff695231a81e2a70a739e8d813525432fd4d
Zefram [Fri, 15 Dec 2017 02:12:42 +0000 (02:12 +0000)]
perldelta e135ff695231a81e2a70a739e8d813525432fd4d

6 years agoperldelta 47836a13cc4c999c9b3589c6797d6769b52c37fd
Zefram [Fri, 15 Dec 2017 02:11:13 +0000 (02:11 +0000)]
perldelta 47836a13cc4c999c9b3589c6797d6769b52c37fd

6 years agoperldelta 3d033384b2016a58c3eed89524dc658660c759ce
Zefram [Fri, 15 Dec 2017 02:09:15 +0000 (02:09 +0000)]
perldelta 3d033384b2016a58c3eed89524dc658660c759ce

6 years agoperldelta 0bd1c35ee47dab181543ba366fe021122c591f65
Zefram [Fri, 15 Dec 2017 02:06:54 +0000 (02:06 +0000)]
perldelta 0bd1c35ee47dab181543ba366fe021122c591f65

6 years agoperldelta 38e30ca7507a601c2d84596bc51d88c0f3c516b4
Zefram [Fri, 15 Dec 2017 02:03:33 +0000 (02:03 +0000)]
perldelta 38e30ca7507a601c2d84596bc51d88c0f3c516b4

6 years agoperldelta addf67e13a08f45d3bb4c245c821b1ef2767c5a5
Zefram [Fri, 15 Dec 2017 02:00:05 +0000 (02:00 +0000)]
perldelta addf67e13a08f45d3bb4c245c821b1ef2767c5a5

6 years agoperldelta 27d3197f2b90b3534ea74a96fc7e37200baeb9b7
Zefram [Fri, 15 Dec 2017 01:58:26 +0000 (01:58 +0000)]
perldelta 27d3197f2b90b3534ea74a96fc7e37200baeb9b7

6 years agoperldelta d5407247046f2f01c1492998b32b3b148445febe
Zefram [Fri, 15 Dec 2017 01:55:17 +0000 (01:55 +0000)]
perldelta d5407247046f2f01c1492998b32b3b148445febe

6 years agoperldelta 16ada235c332e017667585e1a5a00ce43a31c529
Zefram [Fri, 15 Dec 2017 01:53:56 +0000 (01:53 +0000)]
perldelta 16ada235c332e017667585e1a5a00ce43a31c529

6 years agoperldelta 397baf232086e0a9ad6f881a9614d3dbaea853fc
Zefram [Fri, 15 Dec 2017 01:50:55 +0000 (01:50 +0000)]
perldelta 397baf232086e0a9ad6f881a9614d3dbaea853fc

6 years agoperldelta 0165f7b01e9c43629d0c6f4b5eb2e672abeda51a
Zefram [Fri, 15 Dec 2017 01:48:41 +0000 (01:48 +0000)]
perldelta 0165f7b01e9c43629d0c6f4b5eb2e672abeda51a

6 years agoperldelta dd9e86b4501b7c8aeba1f5ebda9f8907747c443f
Zefram [Fri, 15 Dec 2017 01:46:30 +0000 (01:46 +0000)]
perldelta dd9e86b4501b7c8aeba1f5ebda9f8907747c443f

6 years agoperldelta 9b91093d3e74d13a6e4f67269a587f4ab397998a
Zefram [Fri, 15 Dec 2017 01:44:39 +0000 (01:44 +0000)]
perldelta 9b91093d3e74d13a6e4f67269a587f4ab397998a

6 years agoperldelta b5145c7d479fcfcb104fc6d3d89b4d757ca3cd15
Zefram [Fri, 15 Dec 2017 01:43:34 +0000 (01:43 +0000)]
perldelta b5145c7d479fcfcb104fc6d3d89b4d757ca3cd15

6 years agoperldelta 0301e899536a22752f40481d8a1d141b7a7dda82
Zefram [Fri, 15 Dec 2017 01:39:19 +0000 (01:39 +0000)]
perldelta 0301e899536a22752f40481d8a1d141b7a7dda82

6 years agoperldelta 6c4f4eb174d1e2e9f874786123a699d11ae741f9
Zefram [Fri, 15 Dec 2017 01:32:39 +0000 (01:32 +0000)]
perldelta 6c4f4eb174d1e2e9f874786123a699d11ae741f9

6 years agoperldelta 1af9149031d9f5d2d43b6df59b628a0f2c1041f6
Zefram [Fri, 15 Dec 2017 01:30:38 +0000 (01:30 +0000)]
perldelta 1af9149031d9f5d2d43b6df59b628a0f2c1041f6

6 years agoperldelta bff3de19b083d33895fc03f7d7d092e5830547a5
Zefram [Fri, 15 Dec 2017 01:29:23 +0000 (01:29 +0000)]
perldelta bff3de19b083d33895fc03f7d7d092e5830547a5

6 years agoperldelta b3893bfa90e8810497e2f81458a5a46db611cadf
Zefram [Fri, 15 Dec 2017 01:27:12 +0000 (01:27 +0000)]
perldelta b3893bfa90e8810497e2f81458a5a46db611cadf

6 years agoperldelta 0c9c439d08a65206d442724bcd9fb29fa5a7f937
Zefram [Fri, 15 Dec 2017 01:24:36 +0000 (01:24 +0000)]
perldelta 0c9c439d08a65206d442724bcd9fb29fa5a7f937

6 years agoperldelta 58be57636a42d6c6fd404c48c4e1cb87870182df
Zefram [Fri, 15 Dec 2017 01:20:03 +0000 (01:20 +0000)]
perldelta 58be57636a42d6c6fd404c48c4e1cb87870182df

6 years agoperldelta 7c6e7cf06853eef1d1b271077c402c5f8655fbe6
Zefram [Fri, 15 Dec 2017 01:16:14 +0000 (01:16 +0000)]
perldelta 7c6e7cf06853eef1d1b271077c402c5f8655fbe6

6 years agoperldelta 38a3df78b8fbbdf02988dd5fe691c23a8041334f
Zefram [Fri, 15 Dec 2017 01:14:01 +0000 (01:14 +0000)]
perldelta 38a3df78b8fbbdf02988dd5fe691c23a8041334f

6 years agoperldelta 557714184de18964b954b2c00fa13127fd3f216a
Zefram [Fri, 15 Dec 2017 01:11:47 +0000 (01:11 +0000)]
perldelta 557714184de18964b954b2c00fa13127fd3f216a

6 years agoperldelta 3c0dbbbaeb55e36a6beabd1cfc9f0432053bcaf0
Zefram [Fri, 15 Dec 2017 01:09:48 +0000 (01:09 +0000)]
perldelta 3c0dbbbaeb55e36a6beabd1cfc9f0432053bcaf0

6 years agoperldelta 7270698f29ae2f22f2cdfec7b156a75602cddf68
Zefram [Fri, 15 Dec 2017 01:08:38 +0000 (01:08 +0000)]
perldelta 7270698f29ae2f22f2cdfec7b156a75602cddf68

6 years agoperldelta d3f0c815eccb54ae88550259c06aa395b2274580
Zefram [Fri, 15 Dec 2017 01:07:08 +0000 (01:07 +0000)]
perldelta d3f0c815eccb54ae88550259c06aa395b2274580

6 years agoperldelta 39dc9d148281a0a05168f216359b3bdb696fec66
Zefram [Fri, 15 Dec 2017 01:04:32 +0000 (01:04 +0000)]
perldelta 39dc9d148281a0a05168f216359b3bdb696fec66

6 years agoperldelta 0740a29d60ebd4ff72090340b0140ec2210e90c7
Zefram [Fri, 15 Dec 2017 01:02:39 +0000 (01:02 +0000)]
perldelta 0740a29d60ebd4ff72090340b0140ec2210e90c7

6 years agoperldelta sub constructor documentation
Zefram [Fri, 15 Dec 2017 00:59:13 +0000 (00:59 +0000)]
perldelta sub constructor documentation

Covers commits 68cd13c6081a23a59561d3289dba5a99f73c1463,
a59b17fa6324328a12a1d86a5e187e07ba8cee6c, and
28ef70489d76deb9024de42a0571162f323148c8.

6 years agoperldelta 8bfeb7823012732f6bfd9c65485ae3ad9c0cce8d
Zefram [Fri, 15 Dec 2017 00:56:11 +0000 (00:56 +0000)]
perldelta 8bfeb7823012732f6bfd9c65485ae3ad9c0cce8d

6 years agoperldelta abda9fe0fe75ae824723761c1c98af958f17a41c
Zefram [Fri, 15 Dec 2017 00:51:21 +0000 (00:51 +0000)]
perldelta abda9fe0fe75ae824723761c1c98af958f17a41c

6 years agoperldelta a252c8fe5fbed43d9b362ed97d57a5a7764fac62
Zefram [Fri, 15 Dec 2017 00:47:10 +0000 (00:47 +0000)]
perldelta a252c8fe5fbed43d9b362ed97d57a5a7764fac62

6 years agomake exec keep its argument list more reliably
Zefram [Wed, 6 Dec 2017 21:27:15 +0000 (21:27 +0000)]
make exec keep its argument list more reliably

Bits of exec code were putting the constructed commands into globals
PL_Argv and PL_Cmd, which could then be clobbered by reentrancy.
These are only global in order to manage their freeing, but that's
better managed by using the scope stack.  So replace them with automatic
variables, with ENTER/SAVEFREEPV/LEAVE to free the memory.  Also copy
the strings acquired from SVs, to avoid magic clobbering the buffers of
SVs already read.  Fixes [perl #129888].

6 years agorefer to perldiag from perlfunc
Marco Fontani [Wed, 13 Dec 2017 10:11:44 +0000 (11:11 +0100)]
refer to perldiag from perlfunc

Rather than duplicating information as to which keyword, function, or
operator generates which warning, point the reader to the proper place
to read about which warnings Perl generates in which scenario, which are
well described in the POD for "warnings".  [perl #116080]

6 years agodon't lose mark when pp_reverse extends stack
Zefram [Fri, 8 Dec 2017 19:23:29 +0000 (19:23 +0000)]
don't lose mark when pp_reverse extends stack

Nullary reverse needs to extend the stack to push its result scalar.
It was actually extending the stack, but doing so invalidated MARK,
which it relied upon to place the stack pointer afterwards.  Upon stack
reallocation it was therefore leaving the stack pointer pointing to the
freed stack memory.  Reformulate stack manipulation to not rely on MARK
after extending.  Fixes [perl #132544].

6 years agoRevert "re_intuit_start(): rename some local vars"
David Mitchell [Thu, 14 Dec 2017 09:32:46 +0000 (09:32 +0000)]
Revert "re_intuit_start(): rename some local vars"

This reverts commit ea569f0097183cb2c1b98852f31b47264605f0b7.

This was just a cosmetic (if useful) change and clashes with a branch
Yves is working on. So I'll redo it some other time.

6 years agowarn on $a.$b.$c in void context
Zefram [Thu, 14 Dec 2017 04:23:58 +0000 (04:23 +0000)]
warn on $a.$b.$c in void context

$a.$b.$c gets transformed early on to execute as ($a.$b).=$c, which didn't
warn about void context becuase .= looks like a useful side effect.
Happily, the recently-added OPpCONCAT_NESTED flag identifies that this
has happened.  Make scalarvoid() pay attention to this flag when a concat
op is put into void context.  Fixes [perl #6997]

6 years agoCwd: Change strcmp into strEQ
Karl Williamson [Thu, 9 Mar 2017 19:06:34 +0000 (12:06 -0700)]
Cwd: Change strcmp into strEQ

The latter is easier to read

6 years agoFix typo in 183a822da3e11eb0f7dba393f5e6f2bc515cffe6
Karl Williamson [Thu, 14 Dec 2017 03:28:53 +0000 (20:28 -0700)]
Fix typo in 183a822da3e11eb0f7dba393f5e6f2bc515cffe6

Spotted by Tony Cook++

6 years agoData::Dumper: Change a strncmp to memBEGINs
Karl Williamson [Thu, 9 Mar 2017 17:54:20 +0000 (10:54 -0700)]
Data::Dumper: Change a strncmp to memBEGINs

The latter is much clearer as to what's going on

6 years agoData::Dumper: Change strcpy to strlcpy
Karl Williamson [Mon, 27 Mar 2017 20:24:41 +0000 (14:24 -0600)]
Data::Dumper: Change strcpy to strlcpy

strlcpy is safer.  This reverts to using strcpy if no version of strlcpy
is available (but one has been available in Perl since 5.9.4)

6 years agoadd preload to .gitignore
Zefram [Thu, 14 Dec 2017 02:37:03 +0000 (02:37 +0000)]
add preload to .gitignore

6 years agofix links in generated HTML documentation
Zefram [Thu, 14 Dec 2017 02:27:28 +0000 (02:27 +0000)]
fix links in generated HTML documentation

Invoke installhtml in the right way for it to generate relative links.
Fix installhtml's code for creating relative links in the index for
split documents.  Update Pod::Html's section name transformer to
match the actual output seen via Pod::Simple::XHTML.  Incidentally
update split-on-head code for the new style of HTML generated by
Pod::Simple::XHTML.  Fixes [perl #110056].

6 years agoAdd PERL_REENTRANT for XS modules
Karl Williamson [Thu, 14 Dec 2017 02:07:04 +0000 (19:07 -0700)]
Add PERL_REENTRANT for XS modules

This allows them to get the reentrant versions of libc functions
automatically.  Previously if they wanted to do this, they had to
declare themselves (shudder) as PERL_CORE or PERL_EXT.

6 years agoperlfunc: Add note about reentrant functions
Karl Williamson [Thu, 14 Dec 2017 01:36:02 +0000 (18:36 -0700)]
perlfunc: Add note about reentrant functions

perl automatically and silently uses reentrant versions of some
functions in threaded perls when such functions are available.  Note
this.

6 years agoautomatic titling in Pod::Html
Zefram [Wed, 13 Dec 2017 22:59:28 +0000 (22:59 +0000)]
automatic titling in Pod::Html

Automatic extraction of a title from the content was lost with the
switch to using Pod::Simple::XHTML for rendering.  It would be tricky
to add in Pod::Simple::XHTML, or anything else integrated into that
parser, because the stream-oriented approach plays poorly with any kind
of lookahead.  Instead go to a two-stage conversion, parsing the input
to tree form using Pod::Simple::SimpleTree and later feeding the tree
to the stream-oriented Pod::Simple::XHTML for output.  Between the two
stages, extract a default title from the tree, in time to use it when
setting options for Pod::Simple::XHTML.  Fixes [perl #110520].

6 years agopp_multiconcat() Use faster UTF-8 variant counting
Karl Williamson [Thu, 23 Nov 2017 06:10:58 +0000 (23:10 -0700)]
pp_multiconcat() Use faster UTF-8 variant counting

6 years agore_intuit_start()/S_reghop3(): don't go beyond end
David Mitchell [Wed, 13 Dec 2017 15:53:51 +0000 (15:53 +0000)]
re_intuit_start()/S_reghop3(): don't go beyond end

RT #132552

when hopping N characters along a string, if the 'end stop' lim wasn't
on a char boundary, the value returned by S_reghop3() could be up to
(but not including) one char's worth of bytes beyond lim.

This is fairly harmless, but gave valgrind/ASan palpitations.

So fixed by this commit.

6 years agore_intuit_start(): rename some local vars
David Mitchell [Wed, 13 Dec 2017 13:14:59 +0000 (13:14 +0000)]
re_intuit_start(): rename some local vars

(no functional changes)

For local variables which hold a length, rename that var with a _c or _b
suffix to indicate whether it holds a byte or character count.

There is a mixture of the two, and it's easy to get confused.

Also, in places, rename vars to more closely match the field they're
extracted from. For example, start_shift is set from the min_offset field
of the check slot of the substrings array, so it makes more sense to call
it check_min_offset_c.

Also add some code comments about what the vars are for.

6 years agoUpgrade Time::Piece from vesion 1.3202 to 1.3203
Steve Hay [Wed, 13 Dec 2017 08:37:43 +0000 (08:37 +0000)]
Upgrade Time::Piece from vesion 1.3202 to 1.3203

6 years agoinline.h: Fix wrong order of shift and mask
Karl Williamson [Wed, 13 Dec 2017 06:01:02 +0000 (23:01 -0700)]
inline.h: Fix wrong order of shift and mask

I realized that one should mask before the shift in this macro that is
used in is_utf8_invariant_string_loc() and variant_under_utf8_count().
This would only show up on a 32-bit platform that doesn't have 64-bit
ability at all.

6 years agorevise advice about DESTROY
Zefram [Wed, 13 Dec 2017 03:50:01 +0000 (03:50 +0000)]
revise advice about DESTROY

perlobj advised that a DESTROY method dying could clobber $@ for an
exception being thrown, which is no longer true since 5.14.  Remove that
caveat, and fix the description of what happens when a DESTROY method
dies.  Revise the related advice about localising global status variables,
including a list of all affected variables.  Fixes [perl #121761] and
[perl #122753].

6 years agoUpdate Filter::Util::Call to CPAN version 1.58
Chris 'BinGOs' Williams [Tue, 12 Dec 2017 11:39:20 +0000 (11:39 +0000)]
Update Filter::Util::Call to CPAN version 1.58

  [DELTA]

1.58 2017-11-15 rurban
----
  * Drop 5.005 support
  * Switch from DynaLoader to XSLoader [atoomic #5]
  * Replace use vars by our. [atoomic #5]
  * Lazy load Carp only when required. [atoomic #5]
  * Minor test improvements
  * Fix v5.8 cast warnings

6 years agoUpdate B-Debug to CPAN version 1.26
Chris 'BinGOs' Williams [Tue, 12 Dec 2017 11:32:35 +0000 (11:32 +0000)]
Update B-Debug to CPAN version 1.26

  [DELTA]

1.26 2017-12-03 rurban
  * Avoid too many -I when calling subprocess (sprout, RT#123816)

6 years agoUpdate experimental to CPAN version 0.019
Chris 'BinGOs' Williams [Tue, 12 Dec 2017 11:29:29 +0000 (11:29 +0000)]
Update experimental to CPAN version 0.019

  [DELTA]

0.019     2017-12-03 18:40:19+01:00 Europe/Amsterdam
          - Rerelease without NYTProf files

6 years agorevise doc about returning values from threads
Zefram [Tue, 12 Dec 2017 11:54:04 +0000 (11:54 +0000)]
revise doc about returning values from threads

Returning subs is now generally fine, as is creating threads in BEGIN
blocks et al.  Describe the problems that come from losing the identity
of returned objects.  Fixes [perl #96538].

6 years agobetter document version check aspect of "use"
Zefram [Tue, 12 Dec 2017 10:16:46 +0000 (10:16 +0000)]
better document version check aspect of "use"

6 years agofix GvSV refcounting in sort
Zefram [Tue, 12 Dec 2017 09:47:41 +0000 (09:47 +0000)]
fix GvSV refcounting in sort

Where a sort operation passes the comparands to a comparison block in $a
and $b, it wasn't taking account of the fact that the GvSV slots in *a
and *b are refcounted.  It would write the comparands into those slots
without altering any reference counts, and end by restoring the values
those slots had to start with.  This was all fine so long as nothing
else touched those slots during the process.  But code running during
the comparison is free to write to them by "*a = \1", which does frob
the reference counts.

Fix it by switching sort to manipulate GvSV in a refcount-preserving
manner, compatible with all other operations on those slots.  Fixes
[perl #92264].

6 years agoUpgrade CPAN from version 2.18-TRIAL to 2.20-TRIAL
Steve Hay [Tue, 12 Dec 2017 08:21:04 +0000 (08:21 +0000)]
Upgrade CPAN from version 2.18-TRIAL to 2.20-TRIAL

6 years agoproperly check readpipe()'s argument list
Zefram [Tue, 12 Dec 2017 06:24:01 +0000 (06:24 +0000)]
properly check readpipe()'s argument list

readpipe() wasn't applying context to its argument list, resulting in
readpipe()'s context leaking in, and broken stack discipline when a list
expression was used.  Fixes [perl #4574].

6 years agofix doc about filter subroutines' $_[0]
Zefram [Tue, 12 Dec 2017 03:53:33 +0000 (03:53 +0000)]
fix doc about filter subroutines' $_[0]

Filter subroutines established by an @INC callback have always received
a numeric zero as their first argument, not a referencet to the sub
as documented.  Fixes [perl #115754].

6 years agocorrect detection of arg absence in Data::Dumper
Zefram [Tue, 12 Dec 2017 03:19:26 +0000 (03:19 +0000)]
correct detection of arg absence in Data::Dumper

The combined getter/setter methods were mistaking a supplied undef
argument value (of a setter call) for absence of an argument (making it
a getter call).  Fixes [perl #113090].

6 years agosv.c: White-space only
Karl Williamson [Fri, 8 Dec 2017 01:47:34 +0000 (18:47 -0700)]
sv.c: White-space only

This outdents some lines that the previous commit removed an enclosing
block of.

6 years agoutf8_upgrade_flags_grow(): Use faster variant count
Karl Williamson [Fri, 8 Dec 2017 01:42:53 +0000 (18:42 -0700)]
utf8_upgrade_flags_grow(): Use faster variant count

Now that we have a much faster way of counting the characters that would
expand to two bytes when a string is translated into UTF-8, use that,
instead of trying to choose one of two methods.  This simplifies the
code.  Note that the faster method doesn't happen on EBCDIC platforms,
but the simplification is worth the potential loss of being able to
choose methods.

6 years agoinline.h: Change extensive comment to a link
Karl Williamson [Tue, 12 Dec 2017 02:13:45 +0000 (19:13 -0700)]
inline.h: Change extensive comment to a link

I'm thinking the explanation of how the algorithm works  doesn't belong
in the code, so replace it by the commit number so it can be found
quickly.

6 years agoAdd variant_under_utf8_count() core function
Karl Williamson [Thu, 23 Nov 2017 05:30:16 +0000 (22:30 -0700)]
Add variant_under_utf8_count() core function

This function takes a string that isn't encoded in UTF-8 (hence is
assumed to be in Latin1), and counts how many of the bytes therein
would change if it were to be translated into UTF-8.  Each such byte
would occupy two UTF-8 bytes.

This function is useful for calculating the expansion factor precisely
when converting to UTF-8, so as to know how much to malloc.

This function uses a non-obvious method to do the calculations
word-at-a-time, as opposed to the byte-at-a-time method used now, and
hence should be much faster than the current methods.

The performance change in short string lengths is equivocal.  Here is
the result for a single character and a 64-bit word.

          bytes    words Ratio %
        -------- -------- -------
     Ir    932.0    947.0    98.4
     Dr    325.0    325.0   100.0
     Dw    104.0    104.0   100.0
   COND    136.0    137.0    99.3
    IND     28.0     28.0   100.0

 COND_m      1.0      0.0   Inf
  IND_m      6.0      6.0   100.0

There are some extra instructions executed and an extra branch to check
for and handle the case where we can go word-by-word vs. not.  But the
one cache miss is removed.

The results are essentially the same until we get to being able to
handle a full word.  Some of the extra instructions are to ensure that
if the input is not aligned on a word boundary, that performance doesn't
suffer.

Here's the results for 8-bytes on a 64-bit system.

           bytes    words Ratio %
        -------- -------- -------
     Ir    974.0    955.0   102.0
     Dr    332.0    325.0   102.2
     Dw    104.0    104.0   100.0
   COND    143.0    138.0   103.6
    IND     28.0     28.0   100.0

 COND_m      1.0      0.0     Inf
  IND_m      6.0      6.0   100.0

Things keep improving as the strings get longer.  Here's for 24 bytes.

           bytes    words Ratio %
        -------- -------- -------
     Ir   1070.0    975.0   109.7
     Dr    348.0    327.0   106.4
     Dw    104.0    104.0   100.0
   COND    159.0    140.0   113.6
    IND     28.0     28.0   100.0

 COND_m      2.0      0.0     Inf
  IND_m      6.0      6.0   100.0

And 96:

           bytes    words Ratio %
        -------- -------- -------
     Ir   1502.0   1065.0   141.0
     Dr    420.0    336.0   125.0
     Dw    104.0    104.0   100.0
   COND    231.0    149.0   155.0
    IND     28.0     28.0   100.0

 COND_m      2.0      1.0   200.0
  IND_m      6.0      6.0   100.0

And 10,000

           bytes    words Ratio %
        -------- -------- -------
     Ir  60926.0  13445.0   453.1
     Dr  10324.0   1574.0   655.9
     Dw    104.0    104.0   100.0
   COND  10135.0   1387.0   730.7
    IND     28.0     28.0   100.0

 COND_m      2.0      1.0   200.0
  IND_m      6.0      6.0   100.0

I found this trick on the internet many years ago, but I can't seem to
find it again to give them credit.

6 years agois_utf8_invariant_string(): small speed optimization
Karl Williamson [Tue, 12 Dec 2017 01:17:29 +0000 (18:17 -0700)]
is_utf8_invariant_string(): small speed optimization

This adds a few shifing, masking, and integer arithmetic operations to a
conditional which in return makes sure that one branch is taken only
when it is going to do some good, avoiding a conditional in it.

6 years agoAPItest/t/handy_base.pl: Avoid uninitialized warning
Karl Williamson [Tue, 12 Dec 2017 01:26:52 +0000 (18:26 -0700)]
APItest/t/handy_base.pl: Avoid uninitialized warning

This .pl in /t is generally called from a test file in that directory,
but if run by hand, this commit makes sure things are properly
initialized

6 years agodocument rules for identifying smoke-me branches
Zefram [Mon, 11 Dec 2017 21:25:38 +0000 (21:25 +0000)]
document rules for identifying smoke-me branches

6 years agofakesdio.h: Typo
Father Chrysostomos [Mon, 11 Dec 2017 18:01:35 +0000 (10:01 -0800)]
fakesdio.h: Typo

6 years agoAPItest.xs: shenanigans to avoid warnings
Father Chrysostomos [Mon, 11 Dec 2017 17:59:47 +0000 (09:59 -0800)]
APItest.xs: shenanigans to avoid warnings

We have an unresolved issue that #include "fakesdio.h" causes one
of the typemaps to make assignments between different pointer types,
something we can’t fix straightforwardly with casts, since adding
casts to the default typemap (which we are trying to test) may
suppress real problems in production.  This is a temporary plaster
till we figure out what to do.

6 years agosvleak.t: Disable crashing test
Father Chrysostomos [Mon, 11 Dec 2017 17:56:29 +0000 (09:56 -0800)]
svleak.t: Disable crashing test

till we get to the bottom of it

6 years agoNote schedule for $[ removal in perlvar
Dagfinn Ilmari Mannsåker [Mon, 11 Dec 2017 12:31:30 +0000 (12:31 +0000)]
Note schedule for $[ removal in perlvar

6 years agoS_maybe_multiconcat(): use OPpCONCAT_NESTED flag
David Mitchell [Mon, 11 Dec 2017 12:02:57 +0000 (12:02 +0000)]
S_maybe_multiconcat(): use OPpCONCAT_NESTED flag

RT # 132554

I recently added the OPpCONCAT_NESTED flag to distinguish between

    $a .= ...

and
    $a . $b . $c

where the latter has been optimised into

    ($a . $b) .= $c

Update S_maybe_multiconcat() to recognise this new flag.
It was failing an assert on this code:

    ./perl -e 'H.-w.w.=0'

6 years agoDeclaration after statement in typemap
Father Chrysostomos [Mon, 11 Dec 2017 04:25:59 +0000 (20:25 -0800)]
Declaration after statement in typemap

A follow-up to 6da090e6cb and 732d3893ab.

6 years agoperldelta for #115814
Father Chrysostomos [Mon, 11 Dec 2017 01:13:17 +0000 (17:13 -0800)]
perldelta for #115814

db9848c8d3fb and 6da090e6cb.

6 years agoIncrease $ExtUtils::Typemaps::VERSION to 3.37
Father Chrysostomos [Mon, 11 Dec 2017 00:54:44 +0000 (16:54 -0800)]
Increase $ExtUtils::Typemaps::VERSION to 3.37

6 years agoAvoid newGVgen in blead-upstream modules
Father Chrysostomos [Mon, 11 Dec 2017 00:53:45 +0000 (16:53 -0800)]
Avoid newGVgen in blead-upstream modules

ExtUtils::ParseXS::Typemaps:
Just in documentation, but it’s good to change it, in case peo-
ple copy it.

Time::HiRes:
It doesn’t even use these typemap entries, but I changed it in case
they get used in the future.  (The changes are not identical to the
default typemap, because Time::HiRes is 5.6-compatible, at least
nominally.)

os2/os2.c:
No, this is not a module, but I changed it, too.

Some other instances of newGVgen are already handled properly, or are
just in tests, so I left them alone.

6 years agoAvoid newGVgen in default typemap
Father Chrysostomos [Mon, 11 Dec 2017 00:37:11 +0000 (16:37 -0800)]
Avoid newGVgen in default typemap

newGVgen leaks memory, because it puts it vivifies a typeglob in the
symbol table, without arranging for it to be deleted.  A typemap is not
an appropriate place to use it, since callers of newGVgen are responsible
for seeing that the GV is freed, if they care.

This came up in #115814.

6 years agoperlapio: wrong param type
Father Chrysostomos [Mon, 11 Dec 2017 00:33:22 +0000 (16:33 -0800)]
perlapio: wrong param type

6 years agorevise documentation about set-id
Zefram [Mon, 11 Dec 2017 00:28:43 +0000 (00:28 +0000)]
revise documentation about set-id

perlsec's section on set-id scripts was written confusingly, with several
half-formed references to the long-ago-deleted suidperl, and with temporal
references that are well out of date.  Revise that section, and slightly
expand the perldiag entry for the message about detecting a set-id script.
Add another section to perlsec about sudo.  Fixes [perl #74142].

6 years agoassert well-formedness of argv in perl_parse()
Zefram [Sun, 10 Dec 2017 23:20:18 +0000 (23:20 +0000)]
assert well-formedness of argv in perl_parse()