This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perl5.git
4 years agoregcomp.h: Use actual commit number
Karl Williamson [Wed, 26 Jun 2019 15:06:21 +0000 (09:06 -0600)]
regcomp.h: Use actual commit number

This referred to the commit message, but now that the number has been
determined, use that.

4 years agoAdd ANYOFHr regnode
Karl Williamson [Wed, 5 Jun 2019 17:15:00 +0000 (11:15 -0600)]
Add ANYOFHr regnode

This commit adds a new regnode, ANYOFHr, like ANYOFH, but it also has a
loose upper bound for the first UTF-8 byte matchable by the node.  (The
'r' stands for 'range').  It would be nice to have a tight upper bound,
but to do so requires 4 more bits than are available without changing
the node arguments types, and hence increasing the node size.  Having a
loose bound is better than no bound, and comes essentially free, by
using two unused bits in the current ANYOFH node, and requiring only a
few extra, pipeline-able, mask, etc instructions at run time, no extra
conditionals.  Any ANYOFH nodes that would benefit from having an upper
bound will instead be compiled into this node type.

Its use is based on the following observations.

There are 64 possible start bytes, so the full range can be expressed in
6 bits.  This means that the flags field in ANYOFH nodes containing the
start byte has two extra bits that can be used for something else.

An ANYOFH node only happens when there is no matching code point in the
bit map, so the smallest code point that could be is 256.  The start
byte for that is C4, so there are actually only 60 possible start bytes.
(perl can be compiled with a larger bit map in which case the minimum
start byte would be even higher.)

A second observation is that knowing the highest start byte is above F0
is no better than knowing it's F0.  This is because the highest code
point whose start byte is F0 is U+3FFFF, and all code points above that
that are currently allocated are all very specialized and rarely
encountered.  And there's no likelihood of that changing anytime soon as
there's plenty of unallocated space below that.  So if an ANYOFH node's
highest start byte is F0 or above, there's no advantage to knowing what
the actual max possible start byte is, so leave it as ANYOFH,.

That means the highest start byte we care about in ANYOFHr is EF.  That
cuts the number of start bytes we care about down to 43, still 6 bits
required to represent them, but it allows for the following scheme:

Populate the flags field by subtracting C0 from the lowest start byte
and shift left 2 bits.  That leaves the the bottom two bits unused.
We use them as follows, where x is the start byte of the lowest code
point in the node:

bits
----
11  The upper limit of the range can be as much as (EF - x) / 8
10  The upper limit of the range can be as much as (EF - x) / 4
01  The upper limit of the range can be as much as (EF - x) / 2
00  The upper limit of the range can be as much as  EF

That partitions the loose upper bound into 4 possible ranges, with it
being tighter the closer it is to the strict lower bound.  This makes
the loose upper bound more meaningful when there is most to gain by
having one.

Some examples of what the various upper bounds would be for all the
possibilities of these two bits are:
           Upper bound given the 2 bits
Low bound  11 10 01 00
---------  -- -- -- --
C4         C9 CE D9 EF
D0         D3 D7 DF EF
E0         E1 E3 E7 EF

Start bytes of E0 and above represent many more code points each than
lower ones, as they are 3 byte sequences instead of two.  This scheme
provides tighter bounds for them, which is also a point in its favor.

Thus we have provided a loose upper bound using two otherwise unused
bits.  An alternate scheme could have had the intervals all the same,
but this provides a tighter bound when it makes the most sense to.

For EBCDIC the range is is from C8 to F4,

Tests will be added in a later commit

4 years agoregex: Add lower bound to ANYOFH nodes UTF-8 byte
Karl Williamson [Tue, 4 Jun 2019 18:16:10 +0000 (12:16 -0600)]
regex: Add lower bound to ANYOFH nodes UTF-8 byte

This commit adds a lower bound for the first UTF-8 byte matchable by an
ANYOFH node.  The flags field is otherwise unused, and using it for this
purpose allows code to rule out match possibilities without having to
convert from UTF-8 to code point.

It might be better to do the inverse instead, to have the field be an
upper bound.  The reason is that the conversion is cheap for smaller
numbers.  The commit following mostly addresses this.

4 years agoUse inRANGE for seeing if node is an ANYOFH type
Karl Williamson [Tue, 4 Jun 2019 17:43:17 +0000 (11:43 -0600)]
Use inRANGE for seeing if node is an ANYOFH type

This is easier to read, especially when a third type is added a few
commits ahead.

4 years ago(perl #122112) make sure SIGPIPE is delivered if we test it
Tony Cook [Tue, 25 Jun 2019 05:47:57 +0000 (15:47 +1000)]
(perl #122112) make sure SIGPIPE is delivered if we test it

4 years agoWhite space only in comment
Karl Williamson [Tue, 4 Jun 2019 18:31:03 +0000 (12:31 -0600)]
White space only in comment

4 years agoregcomp.sym: Change regnode description
Karl Williamson [Wed, 5 Jun 2019 17:15:51 +0000 (11:15 -0600)]
regcomp.sym: Change regnode description

Simplify the description for ANYOFb

4 years agoAdditional Net-Ping tests skip if d_getpbyname is undef
Richard Leach [Sun, 19 May 2019 03:34:38 +0000 (03:34 +0000)]
Additional Net-Ping tests skip if d_getpbyname is undef

4 years agoTests for Android stub functions updated for Oreo
Richard Leach [Sun, 19 May 2019 03:27:56 +0000 (03:27 +0000)]
Tests for Android stub functions updated for Oreo

4 years agoFix apidoc macro entries
Karl Williamson [Tue, 25 Jun 2019 14:40:05 +0000 (08:40 -0600)]
Fix apidoc macro entries

This makes various fixes to the text that is used to generate the
documentation.  The dominant change is to add the 'n' flag to indicate
that the macro takes no arguments.  A couple should have been marked
with a D (for deprecated) flag, and a couple were missing parameters,
and a couple were missing return values.

These were spotted by using Devel::PPPort on them.

4 years agohonour $PERL_DESTRUCT_LEVEL on non-debug builds
David Mitchell [Mon, 24 Jun 2019 12:00:25 +0000 (13:00 +0100)]
honour $PERL_DESTRUCT_LEVEL on non-debug builds

This environment variable was previously only checked for on DEBUGGING
builds.

4 years agoFix erroneous references to USE_CBACKTRACE
Steve Hay [Mon, 24 Jun 2019 19:47:26 +0000 (20:47 +0100)]
Fix erroneous references to USE_CBACKTRACE

The #define set in Configure and used in locale.c and util.c is actually
USE_C_BACKTRACE.

Pointed out by NormW in
https://www.nntp.perl.org/group/perl.perl5.porters/2018/04/msg250441.html

4 years ago[MERGE] make optree-walking mostly non-recursive
David Mitchell [Mon, 24 Jun 2019 10:40:30 +0000 (11:40 +0100)]
[MERGE] make optree-walking mostly non-recursive

This branch updates many of the functions in op.c which recursively
walk an op tree during compilation.  This avoids SEGVs from stack
overflow when the op tree is deeply nested, such as
    $n == 1 ? "one" : $n == 2 ? "two" : ....
(especially in code which is auto-generated)

This is particularly noticeable where the code is compiled within a
separate thread, as threads tend to have small stacks by default.

Some functions already avoided recursion by mallocing a buffer
containing a list of ops to visit, but this could be leaked if the code
died during compilation.

Making the functions non-recursive is a lot easier now that the last
node in each OpSIBLING chain holds a pointer back to the parent node.
Where the function needs to recursively visit *every* node, its just a
case of following each child link, then every OpSIBLING link then the
parent link. Where the recursion is more selective, it becomes more
tricky. In some cases I have followed the policy that a node has N kids
and kids I..N need visiting, then start at I and iterate as usual; but
if just kids I and J  needs visiting (but not J+1..N), then do old-style
recursion on nodes I and J. These cases are hopefully rare.

4 years agoPerl_op_lvalue_flags(): make mostly non-recursive
David Mitchell [Fri, 14 Jun 2019 10:26:37 +0000 (11:26 +0100)]
Perl_op_lvalue_flags(): make mostly non-recursive

Recursion is left in a few places where is necessary to call itself
with a different value for 'type'.

4 years agoPerl_op_lvalue_flags() add blank lines
David Mitchell [Wed, 12 Jun 2019 11:03:52 +0000 (12:03 +0100)]
Perl_op_lvalue_flags() add blank lines

... between switch cases for readability.

4 years agoPerl_op_lvalue_flags(): skip OPf_WANT_VOID ops.
David Mitchell [Wed, 12 Jun 2019 10:57:54 +0000 (11:57 +0100)]
Perl_op_lvalue_flags(): skip OPf_WANT_VOID ops.

Currently this function asserts that its 'o' argument is non-VOID;
later when recursing an OP_LIST, it skips any kids which are VOID.

This commit changes it so that the assert becomes a return, and
OP_LIST doesn't check whether its kids are VOID.

Doing it this way makes it easier to shortly make Perl_op_lvalue_flags()
non-recursive.

The only functional difference is that on debugging builds,
Perl_op_lvalue_flags() will no longer fail an assert if inadvertently
called with a VOID op.

4 years agoPerl_op_lvalue_flags(): fixup documentation
David Mitchell [Thu, 6 Jun 2019 12:32:25 +0000 (13:32 +0100)]
Perl_op_lvalue_flags(): fixup documentation

First, move the apidoc text for op_lvalue() to be directly above
Perl_op_lvalue_flags() (it had wandered).

Secondly, add a brief non-API note explaining what the extra 'flags'
parameter does

4 years agoreindent op.c:S_lvref()
David Mitchell [Thu, 6 Jun 2019 12:01:41 +0000 (13:01 +0100)]
reindent op.c:S_lvref()

...  after the previous commit wrapped most if it in a while loop.  Also
put a blank line after each switch case for readability.

4 years agomake op.c:S_lvref() non-recursive
David Mitchell [Thu, 6 Jun 2019 12:00:18 +0000 (13:00 +0100)]
make op.c:S_lvref() non-recursive

4 years agodocument what op.c:S_lvref() does
David Mitchell [Tue, 4 Jun 2019 12:41:21 +0000 (13:41 +0100)]
document what op.c:S_lvref() does

4 years agoop.c: S_lvref(): handle all kids on OP_NULL
David Mitchell [Tue, 4 Jun 2019 12:33:22 +0000 (13:33 +0100)]
op.c: S_lvref(): handle all kids on OP_NULL

For an OP_NULL, his function formerly recursed into *all* its kids
if was an ex-list, otherwise only the first one.

To simplify making this function non-recursive, make it so that it
unconditionally recurses into all the kids.

However for now, also add an assertion that a non ex-list OP_NULL
will only have one child at most. If we find some code which violates
this, then we can nmake a more informed decision as to whether
non ex-list OP_NULL's should have all, or only their first child
examined.

4 years agoClarify purpose of S_looks_like_bool()
David Mitchell [Fri, 31 May 2019 15:59:53 +0000 (16:59 +0100)]
Clarify purpose of S_looks_like_bool()

4 years agomake op.c:S_find_and_forget_pmops() non-recursive
David Mitchell [Fri, 31 May 2019 15:53:42 +0000 (16:53 +0100)]
make op.c:S_find_and_forget_pmops() non-recursive

For every CV that's freed which has a shared optree (e.g. a closure
or between threads), the whole optree is walked looking for PMOPs.
Make that walk non-recursive.

Contrived code that triggers a stack overflow:

{
    my $outer;
    my $e = 'sub { $outer && '
            . join('&&', ('$x') x 100_000)
            . " }";
    #print $e, "\n";
    eval $e;
}

Even after this commit, that code still SEGVs due to a separate stack
blow in Perl_rpeep().

4 years agoPerl_doref(): reindent
David Mitchell [Fri, 31 May 2019 15:02:19 +0000 (16:02 +0100)]
Perl_doref(): reindent

Previous commit added a while loop.

4 years agoPerl_doref(): make non-recursive
David Mitchell [Fri, 31 May 2019 10:58:11 +0000 (11:58 +0100)]
Perl_doref(): make non-recursive

This stops the following code from SEGVing for example:

    my $e = "\$r";
    $e = "+do{$e}" for 1..70_000;
    $e = "push \@{$e}, 1";
    eval $e;

Similarly with a long

    $a[0][0][0][0].....

This commit causes a slight change in behaviour, in that scalar(o)
is now only called once at the end of the top-level doref() call,
rather than at the end of processing each child. This should make no
functional difference, apart from speeding up compiling infinitesimally.

4 years agodocument what Perl_doref does
David Mitchell [Fri, 31 May 2019 09:27:25 +0000 (10:27 +0100)]
document what Perl_doref does

4 years agomake op.c:S_aassign_scan() non-recursive
David Mitchell [Thu, 30 May 2019 13:22:09 +0000 (14:22 +0100)]
make op.c:S_aassign_scan() non-recursive

With this commit and some previous ones, the following code no longer
blows the stack:

    my $e = "1";
    $e = "do { \$x; $e}" for 1..100_000;
    $e = "\@x = $e";
    eval $e;

4 years agomake Perl_op_linklist() non-recursive
David Mitchell [Wed, 29 May 2019 14:57:06 +0000 (15:57 +0100)]
make Perl_op_linklist() non-recursive

4 years agoPerl_op_linklist(): use OPf_KIDS flags
David Mitchell [Wed, 29 May 2019 14:03:42 +0000 (15:03 +0100)]
Perl_op_linklist(): use OPf_KIDS flags

This function just blindly assumes that cUNOPo->op_first is a valid
indication that the op has at least one child. This is successful *most*
of the time. Putting in an assertion caused t/op/lvref.t to fail.

Instead, check the OPf_KIDS flag.

4 years agoPerl_scalarvoid(): add comment saying what it does
David Mitchell [Wed, 29 May 2019 08:49:19 +0000 (09:49 +0100)]
Perl_scalarvoid(): add comment saying what it does

It applies void context, which isn't all that obvious just from the
name.

4 years agoop.c: S_search_const: remove recursion
David Mitchell [Tue, 28 May 2019 16:37:43 +0000 (17:37 +0100)]
op.c: S_search_const: remove recursion

There are a couple of places where this function recurses, but they
are both effectively tail recursion and can be easily eliminated.

4 years agoop.c: add code comments to S_search_const()
David Mitchell [Tue, 28 May 2019 16:25:33 +0000 (17:25 +0100)]
op.c: add code comments to S_search_const()

plus a few blank lines for readability.

4 years agoop.c: S_assignment_type(): make truly trinary
David Mitchell [Tue, 28 May 2019 14:39:50 +0000 (15:39 +0100)]
op.c: S_assignment_type(): make truly trinary

Commit 4fec880468dad87517895b935b19a8d51e98b5a6 converted the
static boolean function S_is_list_assignment() into a 3-valued
function: S_assignment_type().

However, much of the code body still did things like 'return TRUE'.
Replace these with 'return ASSIGN_LIST' etc. These have the same
physical values, so there's no functional change here. But it makes the
code more consistent and readable.

4 years agoPerl_scalar() tail-call optimise
David Mitchell [Wed, 29 May 2019 10:03:26 +0000 (11:03 +0100)]
Perl_scalar() tail-call optimise

The part of this function that scans the children of e.g.

    $scalar = do { void; void; scalar }

applying scalar context only to the last child: tail call optimise that
call to Perl_scalar().

It also adds some extra 'warnings' tests. An earlier attempt at this
patch caused some unrelated tests to start emitting spurious 'useless in
void context' messages, which are covered by the new tests.

This also showed up that the current method for updating PL_curcop
while descending optrees in Perl_scalar/scalarvoid/S_scalarseq is a bit
broken. It gets updated every time a newstate op is seen, but haphazardly
(and sometimes wrongly) restored to &PL_compiling when going back up the
tree. One of the tests is TODO based on PL_curcop being wrong and so the
'no warnings "void"' leaking into an outer scope.

This commit maintains the status quo.

4 years agoPerl_scalar(): doc and reorganise complex bool
David Mitchell [Wed, 29 May 2019 09:32:41 +0000 (10:32 +0100)]
Perl_scalar(): doc and reorganise complex bool

The if statement that scans children applying void context to all except
the last child:

1) document what it does;
2) reorganise it (without changing its logical meaning) to make it
simpler to understand, and to make the next commit easier.

4 years agoPerl_scalar(): indent block
David Mitchell [Tue, 28 May 2019 14:25:48 +0000 (15:25 +0100)]
Perl_scalar(): indent block

.. that has just been wrapped in a while loop.
Whitespace-only change.

4 years agomake Perl_scalar() mostly non-recursive
David Mitchell [Tue, 28 May 2019 14:23:44 +0000 (15:23 +0100)]
make Perl_scalar() mostly non-recursive

Where it just recursively calls scalar() on all its children, instead
iteratively walk the sub-tree, using o->op_sibparent to work back
upwards.

Where it is more complex, such as OP_REPEAT imposing scalar context on its
first arg but not its second, recurse as before.

4 years agofix type in Perl_list()
David Mitchell [Tue, 28 May 2019 11:23:10 +0000 (12:23 +0100)]
fix type in Perl_list()

4 years agoPerl_scalar(): re-order a few switch cases
David Mitchell [Tue, 28 May 2019 11:22:19 +0000 (12:22 +0100)]
Perl_scalar(): re-order a few switch cases

Just a cosmetic change.

4 years agoPerl_scalar(): remove redundant switch labels
David Mitchell [Tue, 28 May 2019 11:19:23 +0000 (12:19 +0100)]
Perl_scalar(): remove redundant switch labels

Remove some explicit cases that just do the same as 'default:'

4 years agoDocument what Perl_scalar() does
David Mitchell [Tue, 28 May 2019 11:17:12 +0000 (12:17 +0100)]
Document what Perl_scalar() does

and add blank lines for e.g. better readability between switch() cases.
Also remove a lying /* FALLTHROUGH */

4 years agoPerl_list() tail-call optimise
David Mitchell [Tue, 18 Jun 2019 14:11:12 +0000 (15:11 +0100)]
Perl_list() tail-call optimise

The part of this function that scans the children of e.g.

    @a = do { void; void; list }

applying list context only to the last child, tail call optimise that
call to list().

(See also a few commits later entitled "Perl_scalar() tail-call
optimise" for a discourse on setting PL_curcop (in)correctly.)

4 years agoPerl_list(): doc and reorganise complex bool
David Mitchell [Wed, 29 May 2019 10:22:48 +0000 (11:22 +0100)]
Perl_list(): doc and reorganise complex bool

The if statement that scans children applying void context to all except
the last child:

1) document what it does;
2) reorganise it (without changing its logical meaning) to make the next
commit easier.

4 years agoreindent Perl_list()
David Mitchell [Tue, 28 May 2019 10:25:22 +0000 (11:25 +0100)]
reindent Perl_list()

The previous commit wrapped most of the body of this function in a while
loop.

4 years agomake Perl_list() mostly non-recursive
David Mitchell [Tue, 28 May 2019 09:57:46 +0000 (10:57 +0100)]
make Perl_list() mostly non-recursive

Where it just recursively calls list() on all its children, instead
iteratively walk the sub-tree, using o->op_sibparent to work back
upwards.

Where it is more complex, such as OP_REPEAT imposing list context on its
first arg but not its second, recurse as before.

4 years agoPerl_list(): re-order a few switch cases
David Mitchell [Tue, 28 May 2019 09:08:45 +0000 (10:08 +0100)]
Perl_list(): re-order a few switch cases

Just a cosmetic change.

4 years agoPerl_list(): re-order recursion in OP_LIST
David Mitchell [Tue, 28 May 2019 08:57:04 +0000 (09:57 +0100)]
Perl_list(): re-order recursion in OP_LIST

Call list() on an OP_LIST's children, *after* potentially nulling out
the OP_LIST and an OP_PUSHMARK. This will make removing recursion
easier. Should be no functional difference.

4 years agoPerl_list(): add blank lines
David Mitchell [Wed, 22 May 2019 10:31:06 +0000 (11:31 +0100)]
Perl_list(): add blank lines

... between switch cases for readability.

4 years agoPerl_list(): simplify some branches
David Mitchell [Wed, 22 May 2019 10:27:20 +0000 (11:27 +0100)]
Perl_list(): simplify some branches

Remove some explicit cases that just do the same as 'default:'

Also, remove OP_FLOP as a special case and just let it do the default.
This is the same behaviour (apply list() to its one child), except
that it also now does a harmless but (always false) check whether it's
child is an OP_FLOP too.

4 years agomake S_gen_constant_list() void return
David Mitchell [Fri, 17 May 2019 12:01:35 +0000 (13:01 +0100)]
make S_gen_constant_list() void return

Its gen_constant_list(o) returns an OP*, but the thing it returns is
currently always o.

So just assume it returns it arg.

This will shortly make making Perl_list() non-recursive easier.

4 years agoDocument what Perl_list() and its helper do
David Mitchell [Fri, 17 May 2019 11:58:38 +0000 (12:58 +0100)]
Document what Perl_list() and its helper do

4 years agoremove DEFER_OP macros from op.c
David Mitchell [Wed, 15 May 2019 10:06:49 +0000 (11:06 +0100)]
remove DEFER_OP macros from op.c

the previous commit removed the last use of them

4 years agoS_optimize_op(): remove anti-recursion deferring
David Mitchell [Tue, 14 May 2019 15:47:06 +0000 (16:47 +0100)]
S_optimize_op(): remove anti-recursion deferring

S_optimize_op() used to recursively work its way down an optree
marking ops as being in the appropriate context.

This commit removes the deferred mechanism, and instead makes use of the
newish OP_PARENT mechanism to iterate over the optree, following each
kid, then back up via the parent pointer to the next sibling etc.

4 years agoMake op_free() non-recursive
David Mitchell [Mon, 8 Apr 2019 13:17:59 +0000 (14:17 +0100)]
Make op_free() non-recursive

Stop using the DEFER mechanism (which could leak if something croaks)
and instead tree walk using the new OP_PARENT link to allow walking
back up the tree.

The freeing is done depth-first: children are freed before their
parents.

4 years agoscalarvoid(): remove anti-recursion deferring
David Mitchell [Fri, 5 Apr 2019 14:38:24 +0000 (15:38 +0100)]
scalarvoid(): remove anti-recursion deferring

Perl_scalarvoid() used to recursively work its way down an optree
marking ops as being in the appropriate context.

Around 5.22.0 the code was changed to avoid recursion, and instead to
malloc a buffer (if necessary) to maintain a list of deferred child ops
that need visiting. This stopped perl crashing if the optree (and thus
the recursion) was too deep, but it introduced a potential leak.
For example

    use warnings FATAL => qw(void);
    $a = "abc";
    length $a ;

The fatal warning causes scalarvoid() to leak the deferred buffer.

This commit removes the deferred mechanism, and instead makes use of the
newish OP_PARENT mechanism to iterate over the optree, following each
kid, then back up via the parent pointer to the next sibling etc.

4 years agoperldelta for 9918f0bc5148
Tony Cook [Mon, 24 Jun 2019 01:14:00 +0000 (11:14 +1000)]
perldelta for 9918f0bc5148

4 years ago(perl #134189) handle no gcc, but cc is clang
Tony Cook [Thu, 13 Jun 2019 04:04:35 +0000 (04:04 +0000)]
(perl #134189) handle no gcc, but cc is clang

You can setup Ubuntu (and presumably other dists) with clang and no
gcc installed, which left plibpth unfilled.

4 years agoMake -Duse64bitint the default on VMS.
Craig A. Berry [Sun, 23 Jun 2019 03:09:04 +0000 (22:09 -0500)]
Make -Duse64bitint the default on VMS.

The capability came along with Alpha more than two decades ago, so
maybe the third decade of the twenty-first century should see it
become the default.

4 years agoBegin restore of case sensitive symbols on VMS
Craig A. Berry [Sun, 23 Jun 2019 03:00:10 +0000 (22:00 -0500)]
Begin restore of case sensitive symbols on VMS

There is a long-unmaintained option to build with case sensitive
symbols, which is needed by some extensions that have symbols
that differ only by case and need the Perl core to be built with
the same option.

There will be additional steps necessary, but getting "perl" and
"globals" in the correct case is a start.  We no longer need to
explicitly specify globals for the linker, so don't do that and
thus avoid having to guess which case it wants.

4 years agoFix Unix-format path in Devel::PPPort's Makefile.PL
Craig A. Berry [Sun, 23 Jun 2019 02:26:51 +0000 (21:26 -0500)]
Fix Unix-format path in Devel::PPPort's Makefile.PL

Post-editing the output of MakeMaker means owning all of its many
platform-specific abstractions, in this case the fact that
t/01_test.t might actually be [.t]01_test.t, t\01_test.t, etc.,
constructed for the parsing pleasure of the native make utility.

So when scanning make rules for this test make a regex that
should match on most platforms, at least if they preserve
filename case.  And delete the redundant dependency on pure_all
because, except for the hard-coded Unix-format path, it's already
been correctly inserted by MakeMaker.

No version bump for now as e01077d94eaee34f1361857373 seems to
think we shouldn't, though I'm not sure I follow its rationale.

4 years agoRevert previous changes to pod/perl5311delta.pod
Nicolas R [Fri, 21 Jun 2019 23:26:05 +0000 (18:26 -0500)]
Revert previous changes to pod/perl5311delta.pod

4 years agoTemporary bump PPPort to 3.54 before next release
Nicolas R [Fri, 21 Jun 2019 20:46:27 +0000 (16:46 -0400)]
Temporary bump PPPort to 3.54 before next release

This is making porting/cmp_version.t happy for now.
We plan to release Devel::PPPort over the next days/weeks
and this would be required before the next release.

Note that previous Perl version was release without
releasing Devel::PPPort. We probably want to release
a 3.53 version matching it, followed by a 3.54 one.

4 years agoignore macOS .DS_Store files
Nicolas R [Fri, 14 Jun 2019 16:21:45 +0000 (10:21 -0600)]
ignore macOS .DS_Store files

(cherry picked from commit 98181351f809838fa9a239c16e0cbb25dc16d659)
Signed-off-by: Nicolas R <atoomic@cpan.org>
4 years agoFix unused variable warning in 5.30
Nicolas R [Fri, 14 Jun 2019 15:05:43 +0000 (09:05 -0600)]
Fix unused variable warning in 5.30

Fixes #99

(cherry picked from commit 4aa658c84dee2b1ea29f2683151bab5543da6c6e)
Signed-off-by: Nicolas R <atoomic@cpan.org>
4 years agoFor gcc compiler enable compile warnings
Pali [Tue, 11 Jun 2019 09:49:22 +0000 (11:49 +0200)]
For gcc compiler enable compile warnings

(cherry picked from commit b6d631d5a258ad6b22ec8fe038b1db9d4ef18908)
Signed-off-by: Nicolas R <atoomic@cpan.org>
4 years agoUpdate NEED_* list in apicheck.pl
Pali [Tue, 11 Jun 2019 08:23:50 +0000 (10:23 +0200)]
Update NEED_* list in apicheck.pl

This NEED_* list in apicheck.pl is not automatically generated or updated.

(cherry picked from commit dc9459686897182bff1a157f6be9caf324029838)
Signed-off-by: Nicolas R <atoomic@cpan.org>
4 years agoRemove old #define NEED_vnewSVpvf
Pali [Tue, 11 Jun 2019 08:19:16 +0000 (10:19 +0200)]
Remove old #define NEED_vnewSVpvf

Since f5d27a8 it is not needed.

(cherry picked from commit e609df1c14b00fc4f1a800a2077b637ce5fc7552)
Signed-off-by: Nicolas R <atoomic@cpan.org>
4 years agoDevel::PPPort: Implement newSVsv_nomg()
Pali [Wed, 13 Feb 2019 13:58:08 +0000 (14:58 +0100)]
Devel::PPPort: Implement newSVsv_nomg()

(cherry picked from commit 4cdb0bb9430ff854e6683e74efab8ac096c8c8ad)
Signed-off-by: Nicolas R <atoomic@cpan.org>
(cherry picked from commit 2bcd1c9ab24c4d77e7a636d7d9aa9ef44842f052)
Signed-off-by: Nicolas R <atoomic@cpan.org>
4 years agoDevel::PPPort: Implement SV_NOSTEAL for sv_setsv_flags()
Pali [Fri, 20 Jul 2018 14:49:03 +0000 (16:49 +0200)]
Devel::PPPort: Implement SV_NOSTEAL for sv_setsv_flags()

(cherry picked from commit 63beb3be5c3584094d6eed159067f9f7e71996bd)
Signed-off-by: Nicolas R <atoomic@cpan.org>
(cherry picked from commit e357148a8002d3227d86c5468fd9b63c54c07854)
Signed-off-by: Nicolas R <atoomic@cpan.org>
4 years agoFix processing ERRSV and croak_sv
Pali [Mon, 3 Jun 2019 13:09:20 +0000 (15:09 +0200)]
Fix processing ERRSV and croak_sv

ERRSV macro is function call, so ensure that it is not called more times.
Therefore pass it only to macros which evaluate its arguments only once.

Backported croak_sv() macro is changed to evaluate its argument only once,
like implementation in core Perl.

(cherry picked from commit 2a8cd79042fe49b26b5654d9597dfd9d750783f4)
Signed-off-by: Nicolas R <atoomic@cpan.org>
4 years agoGenerate Makefile dependences for ppport.h, PPPort.pm, RealPPPort.xs and tests
Pali [Sun, 2 Jun 2019 10:50:22 +0000 (12:50 +0200)]
Generate Makefile dependences for ppport.h, PPPort.pm, RealPPPort.xs and tests

All test files and PPPort.pm depend on all include files in parts/inc.
Also RealPPPort.xs depends on ppport.h and ppport.h depends on PPPort.pm.

Test file t/01_test.t is generated when all test files are regenerated. All
test targets depends on pure_all target, so add t/01_test.t as dependency
for pure_all.

Also all those generated files, needed for building PPPort binary should
not depend on built PPPort binary. So ensure that they do not depend on
pm_to_blib target, which depends on built PPPort in blib/ (as it is
circular dependency).

Dependences are injected via MY::processPL method by updating corresponding
Makefile targets.

So make test now run mktests.PL if test files are not up-to-date prior
running tests.

(cherry picked from commit 1e0b1139a2d64cb9c7d3e9dbbb4aa043f7183f36)
Signed-off-by: Nicolas R <atoomic@cpan.org>
4 years agoAdd mktests.PL to MakeMaker's PL_FILES
Pali [Sun, 2 Jun 2019 10:49:20 +0000 (12:49 +0200)]
Add mktests.PL to MakeMaker's PL_FILES

This would ensure that mktests.PL is run from make all. Every script in
PL_FILES must generate file, so add empty test 01_test file for it.

(cherry picked from commit 74263dc21b864812d7996df9cb6c8f2153b33f20)
Signed-off-by: Nicolas R <atoomic@cpan.org>
4 years agoppptools.pl: Remove special case
Karl Williamson [Fri, 31 May 2019 16:26:20 +0000 (10:26 -0600)]
ppptools.pl: Remove special case

The latest doc entries have a flag indicating that special handling is
used.  Use this flag here instead of knowing the specific current cases
that required it.

(cherry picked from commit f548bffdc1ec2dfa00287c7be4dc3db1354a550c)
Signed-off-by: Nicolas R <atoomic@cpan.org>
4 years agoUse latest blead embed.fnc
Karl Williamson [Fri, 31 May 2019 16:24:12 +0000 (10:24 -0600)]
Use latest blead embed.fnc

This comes with different meanings for some of the flags, so those are
updated too.

This resolves the issue with 'mysterious name'

(cherry picked from commit e4aa2c33a3bc4e3c4c62d588a7d1d3149c65b298)
Signed-off-by: Nicolas R <atoomic@cpan.org>
4 years agoppptools.pl: Don't store non-public functions
Karl Williamson [Fri, 31 May 2019 16:20:44 +0000 (10:20 -0600)]
ppptools.pl: Don't store non-public functions

D:P shouldn't be making available things that aren't in the public API.
(cherry picked from commit 0834e32743a278f0737d0b20db77301aba5cd83c)
Signed-off-by: Nicolas R <atoomic@cpan.org>
4 years agomkapidoc.sh: Add required line to generated apidoc.fnc
Karl Williamson [Fri, 31 May 2019 16:16:12 +0000 (10:16 -0600)]
mkapidoc.sh: Add required line to generated apidoc.fnc

Instead of expecting whoever is updating the embed.fnc to remember that
this extra line is required, do it while parsing it.  This means that
the embed.fnc can just be copied from the latest blead.

(cherry picked from commit 129fd7f72ac04fa279e3a01de050dddea82d4a3c)
Signed-off-by: Nicolas R <atoomic@cpan.org>
4 years agomkapidoc.sh: doc elements may have lead/trail space
Karl Williamson [Fri, 31 May 2019 16:11:48 +0000 (10:11 -0600)]
mkapidoc.sh: doc elements may have lead/trail space

Entries in embed.fnc and =for apidoc have elements separated by '|', but
in fact space should be ignored adjacent to them.

(cherry picked from commit 4698ebfa8a1fa20790b96c1ec1c41a0430dd0e27)
Signed-off-by: Nicolas R <atoomic@cpan.org>
4 years agoparts/inc/uv: A char* should be a U8*
Karl Williamson [Fri, 31 May 2019 16:34:20 +0000 (10:34 -0600)]
parts/inc/uv: A char* should be a U8*

(cherry picked from commit 3e80164d818c083465c9b6ec7e3bbd6bbc728aae)
Signed-off-by: Nicolas R <atoomic@cpan.org>
4 years agoAvoid usage of PL_Sv if possible
Pali [Fri, 31 May 2019 10:15:32 +0000 (12:15 +0200)]
Avoid usage of PL_Sv if possible

(cherry picked from commit 4f8e73bc1ae4c90c71f994ad8ba85159561b269e)
Signed-off-by: Nicolas R <atoomic@cpan.org>
4 years agoFix gv_fetchpvn_flags
Pali [Thu, 30 May 2019 09:24:32 +0000 (11:24 +0200)]
Fix gv_fetchpvn_flags

* Add support for GV_NOADD_MASK flag
* Add support for sv_type argument
* Define it as macro without NEED_* define

(cherry picked from commit 88a9d883f3e2e86c1a085f336933266136949ed1)
Signed-off-by: Nicolas R <atoomic@cpan.org>
4 years agoDefine more API functions as macros
Pali [Mon, 27 May 2019 10:37:50 +0000 (12:37 +0200)]
Define more API functions as macros

So their usage via ppport.h can be done via specifying corresponding NEED_.

(cherry picked from commit 28098b495a98ed86fa40faee76c58463a14683cd)
Signed-off-by: Nicolas R <atoomic@cpan.org>
4 years agoFix compilation of uv for Perl 5.5.3
Pali [Sun, 26 May 2019 08:31:44 +0000 (10:31 +0200)]
Fix compilation of uv for Perl 5.5.3

There is no warnings.pm, so it cannot be 'use'-d. Also there is no
UTF8_SAFE_SKIP() so it must be in section after 'skip:'.

(cherry picked from commit f8471054ec5b3940fbeb7f1cdcf52a7825024e3b)
Signed-off-by: Nicolas R <atoomic@cpan.org>
4 years agoFix utf8_to_uvchr_buf()
Pali [Sun, 26 May 2019 08:18:59 +0000 (10:18 +0200)]
Fix utf8_to_uvchr_buf()

API defines first argument of utf8_to_uvchr_buf() as const. So users of
this API expects that they can pass const variable. Fix it by explicit
casting of non-const var to const in D_PPP_utf8_to_uvchr_buf_callee() call.

Change also tests to verify that const argument can be really passed.

Remove utf8_to_uvchr_buf() from TODO list as it is now implemented.

Do not compile test functions which are not provided for older Perl
versions.

(cherry picked from commit cde3c8256deae674cd7e25eaac2a8bbf82b37899)
Signed-off-by: Nicolas R <atoomic@cpan.org>
4 years agoparts/inc/uv: Use D_PP_ prefix for internal symbols
Karl Williamson [Fri, 17 May 2019 18:11:02 +0000 (12:11 -0600)]
parts/inc/uv: Use D_PP_ prefix for internal symbols

Suggested by Pali

(cherry picked from commit de9fb8809c8dde341241153aaff85ff202e87a67)
Signed-off-by: Nicolas R <atoomic@cpan.org>
4 years agoparts/inc/uv: White-space changes only
Karl Williamson [Fri, 17 May 2019 18:09:37 +0000 (12:09 -0600)]
parts/inc/uv: White-space changes only

(cherry picked from commit b9864ade1343063d3449372aafc8a40f3118b257)
Signed-off-by: Nicolas R <atoomic@cpan.org>
4 years agoIssue #72 utf8_to_uvchr fails for 5.6.0
Karl Williamson [Fri, 17 May 2019 18:03:16 +0000 (12:03 -0600)]
Issue #72 utf8_to_uvchr fails for 5.6.0

And the underlying implementation for 5.6.0 is so different from
anything that came later, that we aren't implementing it, and this
causes things to compile

(cherry picked from commit d2d2e9f36066b9391be9546d6ae5cb78304245e5)
Signed-off-by: Nicolas R <atoomic@cpan.org>
4 years agoIssue #71: Overflow failures with <= 5.8.6
Karl Williamson [Fri, 17 May 2019 17:47:07 +0000 (11:47 -0600)]
Issue #71: Overflow failures with <= 5.8.6

These versions need more work to get right; this commit does that.

(cherry picked from commit ebe8b7681463dd9f7a23716166a8861ce6514ae2)
Signed-off-by: Nicolas R <atoomic@cpan.org>
4 years agoparts/inc/uv: Add some UNLIKELY()s
Karl Williamson [Fri, 17 May 2019 17:42:54 +0000 (11:42 -0600)]
parts/inc/uv: Add some UNLIKELY()s

These will be very uncommonly encountered

(cherry picked from commit 804f380c1272b22f4d7cec72453b7e0558a6be16)
Signed-off-by: Nicolas R <atoomic@cpan.org>
4 years agoparts/inc/uv: Use IV_MAX instead of PERL_INT_MAX
Karl Williamson [Fri, 17 May 2019 17:35:24 +0000 (11:35 -0600)]
parts/inc/uv: Use IV_MAX instead of PERL_INT_MAX

This conditional really is about IVs.

(cherry picked from commit dde86fdb411a443543ab98b785c1328c24481166)
Signed-off-by: Nicolas R <atoomic@cpan.org>
4 years agoparts/inc/uv: Combine two preprocessor directives onto same line
Karl Williamson [Fri, 17 May 2019 17:25:37 +0000 (11:25 -0600)]
parts/inc/uv: Combine two preprocessor directives onto same line

I didn't know this special one was combinable.

(cherry picked from commit ae169237b9646630f9f58fe322c478caf7532b8b)
Signed-off-by: Nicolas R <atoomic@cpan.org>
4 years agoparts/inc/uv: Comments only
Karl Williamson [Fri, 17 May 2019 17:20:07 +0000 (11:20 -0600)]
parts/inc/uv: Comments only

(cherry picked from commit 15e6555487e5d4c05a50abed6a69efb1b453b73a)
Signed-off-by: Nicolas R <atoomic@cpan.org>
4 years agoparts/inc/uv: Add two tests of overlongs
Karl Williamson [Fri, 17 May 2019 17:07:12 +0000 (11:07 -0600)]
parts/inc/uv: Add two tests of overlongs

This now has a test for each possible overlong range in the legal
Unicode range.  Those have start bytes of C0 or C1, E0, and F0.

(cherry picked from commit fe97c4cc6e837cf123a0d777fb65575d7bf9f828)
Signed-off-by: Nicolas R <atoomic@cpan.org>
4 years agoparts/inc/uv: Skip only some tests on early perls
Karl Williamson [Fri, 17 May 2019 17:01:02 +0000 (11:01 -0600)]
parts/inc/uv: Skip only some tests on early perls

This was skipping every test, not just the affected ones.

(cherry picked from commit 25d26ec2886c6a339ea9fd7e3c5d5531f4c41cd0)
Signed-off-by: Nicolas R <atoomic@cpan.org>
4 years agoparts/inc/uv: Improve diagnostic test name
Karl Williamson [Fri, 17 May 2019 16:56:00 +0000 (10:56 -0600)]
parts/inc/uv: Improve diagnostic test name

(cherry picked from commit 6b2440b318280e1270ad59e6f0030ff93ae4c4df)
Signed-off-by: Nicolas R <atoomic@cpan.org>
4 years agoMove declaration to before code, so can work on C89 compiler
Karl Williamson [Fri, 17 May 2019 18:06:56 +0000 (12:06 -0600)]
Move declaration to before code, so can work on C89 compiler

(cherry picked from commit 95c5effdf058e7f01a1d1797d70474a2b332c0fb)
Signed-off-by: Nicolas R <atoomic@cpan.org>
4 years agodist target now depends on manifest
Nicolas R [Fri, 17 May 2019 15:02:11 +0000 (09:02 -0600)]
dist target now depends on manifest

Fixes GH #68

make sure we regenerate the manifest
when building a dist.

We recently removed on purpose the
MANIFEST file from the git repo to
make sure we always generate a fresh
version on dist...

(cherry picked from commit e90e36f77e7717bfe596adbc50b4210825f1ed56)
Signed-off-by: Nicolas R <atoomic@cpan.org>
4 years agofix dist/Module-CoreList/t/maintainer.t by filling in real release date
Karen Etheridge [Fri, 21 Jun 2019 17:48:33 +0000 (10:48 -0700)]
fix dist/Module-CoreList/t/maintainer.t by filling in real release date

4 years agobump this version check for now, to get tests passing
Karen Etheridge [Fri, 21 Jun 2019 17:25:53 +0000 (10:25 -0700)]
bump this version check for now, to get tests passing

The real fix still needs to be merged from the Devel-PPPort repository.

4 years agoupdating perldelta not needed here
Karen Etheridge [Fri, 21 Jun 2019 17:12:57 +0000 (10:12 -0700)]
updating perldelta not needed here

..as the updated modules section is generated automatically when perldelta is finalized

4 years agoadd explicit command to do a clean build
Karen Etheridge [Fri, 21 Jun 2019 17:12:32 +0000 (10:12 -0700)]
add explicit command to do a clean build