This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perl5.git
7 years agot/re/regexp.t: Remove extra semicolons from output.
Dan Collins [Sat, 18 Jun 2016 21:24:22 +0000 (17:24 -0400)]
t/re/regexp.t: Remove extra semicolons from output.

The $code segment in t/re/regexp.t contains an extra ';' for the first iteration
of each test, due to how 'study' and 'utf8::upgrade' testing is implemented.
Since this is the only test likely to fail (what with study being a no-op), this
is almost always line noise. This patch removes that ';'.

It would be nice to remove the back to back newlines as well.

7 years agot/re/regexp.t: Better formatting for test failures
Dan Collins [Sat, 18 Jun 2016 20:52:26 +0000 (16:52 -0400)]
t/re/regexp.t: Better formatting for test failures

On test failure, most of our tests output a description of the test,
followed by the actual result ("got") and the desired result
("expected"). This brings the tests in t/re/re_tests in line by
adding "expected" to the output, and changing the order slightly,
to more naturally describe the test, the output, and the expectation.

7 years agoRT #128255: Assert fail in S_sublex_done
David Mitchell [Fri, 8 Jul 2016 08:48:04 +0000 (09:48 +0100)]
RT #128255: Assert fail in S_sublex_done

Some code that handles deprecated behaviour in formats was triggering
an assertion. This:

    format STDOUT =
    @
    0"$x"

gave this warning:

    Use of comma-less variable list is deprecated

but then gave this panic:

    toke.c:2457: S_sublex_done: Assertion `(PL_parser->lex_inwhat) ==
     OP_SUBST || (PL_parser->lex_inwhat) == OP_TRANS' failed.

This is due to the lexer calling scan_str(), then backing off and doing
the warning and returning a comma, then on the next token get, calling
scan_str() again. Because scan_str() has been called twice, the
second time it extracts the string to PL_sublex_info.repl rather than
PL_lex_stuff, as it does with things like s/foo/bar/ and tr/abc/ABC/.
Later an assert that PL_sublex_info.repl is only set for a s/// or tr///
fails.

The solution seems to be to check and return a comma *before*
trying to call scan_str().

7 years agoSEGV in "Subroutine redefined" warning
David Mitchell [Thu, 7 Jul 2016 16:03:29 +0000 (17:03 +0100)]
SEGV in "Subroutine redefined" warning

RT #128257

The following SEGVed:

    sub P::f{}
    undef *P::;
    *P::f =sub{};

due to the code which generates the "Subroutine STASH::NAME redefined"
warning assuming that the GV always has a stash. Make it so that if it
hasn't, the message changes to  "Subroutine NAME redefined" rather than
just crashing.

7 years agohandle magic in multideref "unit val" var names
David Mitchell [Thu, 7 Jul 2016 15:24:41 +0000 (16:24 +0100)]
handle magic in multideref "unit val" var names

[perl #128253] Assert fail in S_find_uninit_var

    $ perl5240 -we'$ISA[0][0]'
    Useless use of array element in void context at -e line 1.
    perl5240: sv.c:16078: S_find_uninit_var: Assertion `is_hv' failed.

The code in find_uninit_var() which looks for a variable name associated
with an uninitialized value assumed, in the OP_MULTIDEREF branch, that the
value was either an index if the op was top-level ($foo[$uninit]), or an
array/hash element otherwise (1+$foo[...]).

It turns out here's a third possibility: magic. In $ISA[0][0], the first
array lookup is in lval context, so it initially autovivifies to undef.
Normally it would shortly afterwards be upgraded to a ref to an empty AV,
but first ISA set magic for @ISA is invoked. This ends up scanning @ISA
and finds an uninit value which it tries to use as a key into the stash
cache, triggering an ununit value warning.

This commit expands the OP_MULTIDEREF code in find_uninit_var() to handle
this third possibility - chiefly by not returning a variable name unless
the index var is the same SV as the uninit value. As well as fixing the
assert failure in this ticket, it also stops printing an incorrect index in
code like this:

    $ perl -we'my $i = 0; $ISA[$i] = 1'

before:

    ....
    Use of uninitialized value $i in array element at -e line 1.
    Use of uninitialized value $i in array element at -e line 1.
    Recursive inheritance detected in package 'main' at -e line 1.

after:

    ....
    Use of uninitialized value in array element at -e line 1.
    Use of uninitialized value in array element at -e line 1.
    Recursive inheritance detected in package 'main' at -e line 1.

@ISA magic still has recursion issues with undef values, as can be seen
above. I don't address those issues here. Because of that, I haven't
been able to add tests.

7 years agoundeprecate hv_bucket_ratio()
David Mitchell [Thu, 7 Jul 2016 08:40:22 +0000 (09:40 +0100)]
undeprecate hv_bucket_ratio()

This function was recently added, but marked as deprecated in embed.fnc.
Based on this thread:

    http://nntp.perl.org/group/perl.perl5.porters/237486

It looks like the 'M' (may change) flag is sufficient to capture what was
intended. Removing the 'D' avoids every usage in core emitting a warning
to STDERR during build, while it still adds a caution to the entry in
perlapi.pod:

    NOTE: this function is experimental and may change or be
    removed without notice.

7 years agoMinor change after backpotinr
H.Merijn Brand [Wed, 6 Jul 2016 07:03:08 +0000 (09:03 +0200)]
Minor change after backpotinr

The oxford comma makes no sense in a list of just two

7 years agoSynchronize blead with CPAN XSLoader 0.22
Sébastien Aperghis-Tramoni [Tue, 5 Jul 2016 21:53:08 +0000 (14:53 -0700)]
Synchronize blead with CPAN XSLoader 0.22

7 years ago[perl #128538] [PATCH] Fix copy/paste error in Configure
H.Merijn Brand [Tue, 5 Jul 2016 16:49:29 +0000 (18:49 +0200)]
[perl #128538] [PATCH] Fix copy/paste error in Configure

Self-explanatory. The code in question adds -quadmath to archname, but only if it isn't already there. However, since this was copied from a few lines earlier, it checks for -ld instead of -quadmath.

7 years agoThe 47918419 mistakenly made miniperl skippage unconditional
Jarkko Hietaniemi [Tue, 5 Jul 2016 07:59:59 +0000 (10:59 +0300)]
The 47918419 mistakenly made miniperl skippage unconditional

7 years agoUpdate Test-Simple to 1.302037
Chad Granum [Mon, 4 Jul 2016 19:36:02 +0000 (12:36 -0700)]
Update Test-Simple to 1.302037

This includes many bugfixes and documentation updates.

This also fixes a notable bug where one test would pass under the
harness, but fail when run directly under perl (due to perl RT #128530)

For: RT #128536

7 years agoFix XSLoader to recognize drive letters
Father Chrysostomos [Mon, 4 Jul 2016 15:48:57 +0000 (08:48 -0700)]
Fix XSLoader to recognize drive letters

Commit 08e3451d made XSLoader confirm that the file path it got
from (caller)[2] was in @INC if it looked like a relative path.
Not taking drive letters into account, it made that @INC search
mandatory on Windows and some other systems.  It still worked, but
was slightly slower.

7 years agoAbigail volunteered to handle January's release of 5.25.9
Sawyer X [Mon, 4 Jul 2016 19:44:22 +0000 (21:44 +0200)]
Abigail volunteered to handle January's release of 5.25.9

7 years ago[perl #128532] Crash vivifying stub in deleted pkg
Father Chrysostomos [Mon, 4 Jul 2016 05:23:34 +0000 (22:23 -0700)]
[perl #128532] Crash vivifying stub in deleted pkg

v5.17.0-515-g186a5ba, which added newSTUB, did not take into account
that a GV may have a null GvSTASH pointer, if its stash has been
freed, so this crashes:

delete $My::{"Foo::"}; \&My::Foo::foo

7 years agoSilence podcheck.t failure from Data-Dumper's updated Changes file
Steve Hay [Mon, 4 Jul 2016 07:43:43 +0000 (08:43 +0100)]
Silence podcheck.t failure from Data-Dumper's updated Changes file

7 years agoUpgrade Data-Dumper from version 2.154 to 2.160
Steve Hay [Mon, 4 Jul 2016 07:26:29 +0000 (08:26 +0100)]
Upgrade Data-Dumper from version 2.154 to 2.160

7 years agoUpgrade Parse-CPAN-Meta from version 1.4421 to 1.4422
Steve Hay [Mon, 4 Jul 2016 07:24:32 +0000 (08:24 +0100)]
Upgrade Parse-CPAN-Meta from version 1.4421 to 1.4422

7 years agoRevert "FREETMPS when leaving eval, even when void/dying"
David Mitchell [Sun, 3 Jul 2016 21:19:26 +0000 (22:19 +0100)]
Revert "FREETMPS when leaving eval, even when void/dying"

This reverts commit 214949f5cdc4164f25e32c1a6ce989286456c205.

It breaks Variable::Magic.

Temporarily revert while we work out what to do.

7 years agoIncrease $XSLoader::VERSION to 0.22
Father Chrysostomos [Sun, 3 Jul 2016 05:57:46 +0000 (22:57 -0700)]
Increase $XSLoader::VERSION to 0.22

7 years agoDon’t let XSLoader load relative paths
Father Chrysostomos [Sun, 3 Jul 2016 05:56:51 +0000 (22:56 -0700)]
Don’t let XSLoader load relative paths

[rt.cpan.org #115808]

The logic in XSLoader for determining the library goes like this:

    my $c = () = split(/::/,$caller,-1);
    $modlibname =~ s,[\\/][^\\/]+$,, while $c--;    # Q&D basename
    my $file = "$modlibname/auto/$modpname/$modfname.bundle";

(That last line varies by platform.)

$caller is the calling package.  $modlibname is the calling file.  It
removes as many path segments from $modlibname as there are segments
in $caller.  So if you have Foo/Bar/XS.pm calling XSLoader from the
Foo::Bar package, the $modlibname will end up containing the path in
@INC where XS.pm was found, followed by "/Foo".  Usually the fallback
to Dynaloader::bootstrap_inherit, which does an @INC search, makes
things Just Work.

But if our hypothetical Foo/Bar/XS.pm actually calls
XSLoader::load from inside a string eval, then path ends up being
"(eval 1)/auto/Foo/Bar/Bar.bundle".

So if someone creates a directory named ‘(eval 1)’ with a naughty
binary file in it, it will be loaded if a script using Foo::Bar is run
in the parent directory.

This commit makes XSLoader fall back to Dynaloader’s @INC search if
the calling file has a relative path that is not found in @INC.

7 years agoperl.h: Fix typo in comment
Karl Williamson [Sat, 2 Jul 2016 14:49:11 +0000 (08:49 -0600)]
perl.h: Fix typo in comment

7 years ago[perl #128508] Fix line numbers with perl -x
Father Chrysostomos [Sat, 2 Jul 2016 07:08:48 +0000 (00:08 -0700)]
[perl #128508] Fix line numbers with perl -x

When lex_start is invoked with an SV and a handle pointer, it expects
the SV to contain the beginning of the code to be parsed.  The handle
will be read from for subsequent code.

The -x command line option happens to invoke lex_start with two non-
null pointers like this (a line and a handle), since, to find the
#!perl line, it has to read that first line out of the file handle.

There is a line of code in lex_start that adds "\n;" to the buffer
goes back to 8990e30710 (perl 5.0 alpha 6) and string eval fails
catastrophically without it.

As of v5.19.1-485-g2179133 multiple lines are supported in the current
parsing buffer (PL_linestr) when there is a file handle, and as of
v5.19.3-63-gbf1b738 the line number is correctly incremented when the
parser goes past a newline.

So, for -x, "#!perl\n" turns into "#!perl\n\n" (the final ; is skipped
as of v5.19.3-63-gbf1b738 if there is a handle).  That throws line
numbers off by one.

In the case where we have a string to parse and a file handle, the
extra "\n;" added to the end of the buffer turns out to be completely
unnecessary.  So this commit makes it conditional on rsfp.

The existing tests for -x are quite exotic.  I have made no effort to
make them less so.

7 years agoIf only miniperl, no use re for you.
Jarkko Hietaniemi [Sat, 2 Jul 2016 00:14:00 +0000 (20:14 -0400)]
If only miniperl, no use re for you.

7 years agoIf only miniperl, no use utf8 for you.
Jarkko Hietaniemi [Sat, 2 Jul 2016 00:07:18 +0000 (20:07 -0400)]
If only miniperl, no use utf8 for you.

7 years agoVAX: test changes for VAX floats
Jarkko Hietaniemi [Mon, 27 Jun 2016 22:57:14 +0000 (18:57 -0400)]
VAX: test changes for VAX floats

The hexfp (literals or %a) seems to be partially working: simple cases
seem to work, but there are failures.

7 years agoVAX: code changes for VAX floats
Jarkko Hietaniemi [Sun, 26 Jun 2016 02:14:41 +0000 (22:14 -0400)]
VAX: code changes for VAX floats

Mainly to avoid Inf and NaN, which VAX does does not have.

There is something like Inf called "excess" but that is
a deadly exception, seems to manifest itself in vax-netbsd
either as a SIGFPE or SIGSEGV (pretty much untrappable at
least from Perl level).

The range of VAX floats is different from IEEE.

There is positive zero, but no negative zero.

7 years agoVAX: Configure changes for VAX floats
Jarkko Hietaniemi [Sun, 26 Jun 2016 01:57:55 +0000 (21:57 -0400)]
VAX: Configure changes for VAX floats

Detect the VAX floating point formats D and G.

And the F float, but that is float (duh), never likely to be
the double, but do it for consistency (we detect IEEE single
precision floats, too).

The T float and X float are the IEEE 64-bit and 128-bit,
but those were available only on the Alpha.

Tested on vax-netbsd.

7 years agoop_lvalue_flags(): silence compiler warning
David Mitchell [Fri, 1 Jul 2016 10:22:51 +0000 (11:22 +0100)]
op_lvalue_flags(): silence compiler warning

op.c:3071:4: warning: enumeral and non-enumeral type in conditional
             expression [-Wextra]

7 years ago[MERGE] make eval scope exit free temps
David Mitchell [Fri, 1 Jul 2016 10:13:52 +0000 (11:13 +0100)]
[MERGE] make eval scope exit free temps

plus a bunch of cleanup of the eval scope exit code

7 years agoFREETMPS when leaving eval, even when void/dying
David Mitchell [Thu, 30 Jun 2016 09:56:28 +0000 (10:56 +0100)]
FREETMPS when leaving eval, even when void/dying

When a scope is exited normally (e.g. pp_leavetry, pp_leavesub),
we do a FREETMPS only in scalar or list context; in void context
we don't bother for efficiency reasons. Similarly, when there's an
exception and we unwind to (and then pop) an EVAL context, we haven't
been bothering to FREETMPS.

The problem with this in try/eval (exiting normally or via an exception)
is that it can delay some SVs getting freed until *after* $@ has been
set. If that freeing calls a destructor which happens to set $@,
then that overwrites the "real" value of $@.

For example

    sub DESTROY { eval { die "died in DESTROY"; } }
    eval { bless []; };
    is ($@, "");

Before this commit, that test would fail because $@ is "died in DESTROY".

This commit ensures that leaving an eval/try by whatever means always
clears the tmps stack before setting $@.

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

For now, I haven't added a FREETMPS to the other pp_leavefoo()
void context cases, since I can't think of a case where it would
matter.

7 years agodie_unwind(): mortalise, not mortalcopy the err SV
David Mitchell [Thu, 30 Jun 2016 09:12:06 +0000 (10:12 +0100)]
die_unwind(): mortalise, not mortalcopy the err SV

The error string needs to be preserved while unwinding the stacks,
but doing a simple sv_2mortal() and bumping the reference count seems
sufficient, rather than making a complete copy.

Also, avoid the mortalised SV's buffer from being stolen by using the
SV_NOSTEAL flag rather than unsetting SvTEMP.

Finally, add some basic comments above Perl_die_unwind() explaining what
it's for.

7 years agocx_popeval(): don't mortalise blk_eval.old_namesv
David Mitchell [Wed, 29 Jun 2016 08:16:51 +0000 (09:16 +0100)]
cx_popeval(): don't mortalise blk_eval.old_namesv

Currently whenever we pop an eval context used for a require, rather than
freeing the SV holding the name of the require, we just mortalise it,
since some callers of cx_popeval() need the SV to remain long enough to
use it to "undo" %INC and to croak with a message such as ""$name did not
return a true value".

Now that all those usages have been gathered into one place
(S_pop_eval_context_maybe_croak), make that function responsible for
mortalising when there's a require error, and make the general-case case
of cx_popeval() just decrement the reference count.

7 years agoexpand and rename S_undo_inc_then_croak()
David Mitchell [Tue, 28 Jun 2016 20:22:39 +0000 (21:22 +0100)]
expand and rename S_undo_inc_then_croak()

This function is called from 3 places in pp_ctl.c to do things on require
failure like:

    delete $INC{$name};
    croak "$errsv: Compilation failed in require"

After some previous commits, all 3 callers are now very similar around the
time they call this function: for example they all do

    CX_LEAVE_SCOPE(cx);
    cx_popeval(cx);
    cx_popblock(cx);

So incorporate all that into the function too, and rename it to
S_pop_eval_context_maybe_croak() to reflect its expanded role.

7 years agoharmonise die_unwind, doeval_compile, leaveeval
David Mitchell [Tue, 28 Jun 2016 16:14:41 +0000 (17:14 +0100)]
harmonise die_unwind, doeval_compile, leaveeval

There is some similar code in each of these functions. Reorganise each of
those blocks to make them more similar. In particular, move some of the
EVAL context field preserving to earlier; i.e. change

    CX_LEAVE_SCOPE(cx);
    cx_popeval(cx);
    cx_popblock(cx);
    saved_foo = cx->blk_eval.foo;

to

    saved_foo = cx->blk_eval.foo;
    CX_LEAVE_SCOPE(cx);
    cx_popeval(cx);
    cx_popblock(cx);

and always examine the context entry to determine whether the EVAL is a
require, rather than using any other method (but assert they're the same);

and for leaveeval, move the CvDEPTH(evalcv)=0 setting earlier.

7 years agotidy doeval_compile()
David Mitchell [Tue, 28 Jun 2016 15:31:45 +0000 (16:31 +0100)]
tidy doeval_compile()

After the previous commit removed some dead code, the rest of the
code can be re-arranged to be slightly tidier. In particular, this
structure:

    if (foo) {
        ...;
    }
    if (in_require) {
        assert(foo);
        croak(...);
    }

becomes the logically equivalent

    if (foo) {
        ...;
        if (in_require) {
            croak(...);
        }
    }
    assert(!in_require);

7 years agodoeval_compile(): remove dead code
David Mitchell [Tue, 28 Jun 2016 15:22:03 +0000 (16:22 +0100)]
doeval_compile(): remove dead code

The combination of in_require and yystatus ==3 (i.e. we caught a
JUMPENV(3)) should never happen, so remove the code that handles this
combo and replace with an assertion.

I think the dead code was wrong anyway - it re-croaked without having
first popped he current EVAL context.

7 years agoUpgrade Time::HiRes from version 1.9734 to 1.9739
Steve Hay [Fri, 1 Jul 2016 07:27:18 +0000 (08:27 +0100)]
Upgrade Time::HiRes from version 1.9734 to 1.9739

7 years agoUpgrade Parse::CPAN::Meta from version 1.4417 to 1.4421
Steve Hay [Fri, 1 Jul 2016 07:25:16 +0000 (08:25 +0100)]
Upgrade Parse::CPAN::Meta from version 1.4417 to 1.4421

7 years agoChange \p{foo} to mean \p{scx: foo}
Karl Williamson [Fri, 1 Jul 2016 04:05:55 +0000 (22:05 -0600)]
Change \p{foo} to mean \p{scx: foo}

when 'foo' is a script.  Also update the pods correspondingly, and to
encourage scx property use.

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

7 years agoperlapi: Add entry for hv_bucket_ratio
Karl Williamson [Thu, 30 Jun 2016 19:13:17 +0000 (13:13 -0600)]
perlapi: Add entry for hv_bucket_ratio

autodoc doesn't find things like Per_hv_bucket_ratio().

7 years agoUse catfile, not catdir in metadata.t.
Craig A. Berry [Thu, 30 Jun 2016 14:08:31 +0000 (09:08 -0500)]
Use catfile, not catdir in metadata.t.

Otherwise $basename comes up empty on VMS.  Already pushed
upstream as:

https://github.com/Perl-Toolchain-Gang/Module-Metadata/commit/59b3f5b45ff862a1a422a409518255736fe81b66

7 years agoUpgrade version from version 0.9916 to 0.9917
Steve Hay [Tue, 28 Jun 2016 13:18:30 +0000 (14:18 +0100)]
Upgrade version from version 0.9916 to 0.9917

7 years agoUpgrade Test::Simple from version 1.302026 to 1.302035
Steve Hay [Tue, 28 Jun 2016 13:01:47 +0000 (14:01 +0100)]
Upgrade Test::Simple from version 1.302026 to 1.302035

7 years agoWe're in sync with CPAN version 2.14
Steve Hay [Tue, 28 Jun 2016 12:46:07 +0000 (13:46 +0100)]
We're in sync with CPAN version 2.14

7 years agoWe're closer to being in sync with XSLoader 0.20 than with 0.16
Steve Hay [Tue, 28 Jun 2016 12:40:31 +0000 (13:40 +0100)]
We're closer to being in sync with XSLoader 0.20 than with 0.16

(This just drops the module off the list of modules that are "behind" the
latest CPAN release. We're actually slightly *ahead* of CPAN.)

7 years agoUpgrade Perl::OSType from version 1.009 to 1.010
Steve Hay [Tue, 28 Jun 2016 12:35:10 +0000 (13:35 +0100)]
Upgrade Perl::OSType from version 1.009 to 1.010

7 years agoAdd test for RT #128252
David Mitchell [Tue, 28 Jun 2016 09:50:41 +0000 (10:50 +0100)]
Add test for RT #128252

was already fixed by v5.25.2-53-g36efb5a

7 years agoUpgrade Math::BigRat from version 0.260802 to 0.260804
Steve Hay [Tue, 28 Jun 2016 07:54:25 +0000 (08:54 +0100)]
Upgrade Math::BigRat from version 0.260802 to 0.260804

(This removes the blead customization, which is now incorporated with minor
changes.)

7 years agoUpgrade Math::BigInt::FastCalc from version 0.40 to 0.42
Steve Hay [Tue, 28 Jun 2016 07:46:30 +0000 (08:46 +0100)]
Upgrade Math::BigInt::FastCalc from version 0.40 to 0.42

7 years agoUpgrade from Math::BigInt version 1.999715 to 1.999724
Steve Hay [Tue, 28 Jun 2016 07:42:36 +0000 (08:42 +0100)]
Upgrade from Math::BigInt version 1.999715 to 1.999724

7 years agoWe're in sync with Locale::Maketext 1.27
Steve Hay [Tue, 28 Jun 2016 07:30:41 +0000 (08:30 +0100)]
We're in sync with Locale::Maketext 1.27

7 years agoWe're in sync with Getopt::Long 2.49.1
Steve Hay [Tue, 28 Jun 2016 07:28:07 +0000 (08:28 +0100)]
We're in sync with Getopt::Long 2.49.1

7 years agoUpgrade Encode from version 2.80 to 2.84
Steve Hay [Tue, 28 Jun 2016 07:26:38 +0000 (08:26 +0100)]
Upgrade Encode from version 2.80 to 2.84

This retains the customizations to Byte/Makefile.PL (not yet assimilated)
and encoding.pm (can't be removed without a $VERSION++, which would be a
customization again!).

7 years agoS_lvref() OP_[AH]SLICE => OP_LVREFSLICE flag issue
David Mitchell [Mon, 27 Jun 2016 13:56:09 +0000 (14:56 +0100)]
S_lvref() OP_[AH]SLICE => OP_LVREFSLICE flag issue

RT #128252 Assert fail in op.c

In S_lvref(), when it's converting an OP_ASLICE or OP_HSLICE into a
OP_LVREFSLICE op, it clears all private flags except those supported by
both ops.  Except that it got it wrong. OPpLVREF_ELEM isn't a valid flag
for OP_[AH]SLICE (that bit corresponds to OPpSLICEWARNING for [ah]slice)
and that bit isn't valid for OP_LVREFSLICE. So don't preserve that bit.

7 years agopp_aelemfast: always extend stack
David Mitchell [Mon, 27 Jun 2016 06:58:01 +0000 (07:58 +0100)]
pp_aelemfast: always extend stack

my previous commit split pp_aelemfast() into two branches; but the
new branch wasn't extending the stack before pushing the result.

7 years ago[perl #128478] Restore former "$foo::$bar" parsing
Father Chrysostomos [Mon, 27 Jun 2016 04:45:22 +0000 (21:45 -0700)]
[perl #128478] Restore former "$foo::$bar" parsing

The function scan_word, in toke.c, is used to parse barewords.  The
scan_ident function is used to scan an identifier after a sigil.

Prior to v5.17.9-108-g07f7264, both functions had their own parsing
loops, and scan_ident actually had two, one for $foo and another
for ${foo}.

The state purpose of 07f7264 was to fix discrepancies in the parsing
of $foo vs ${foo}, by making the two forms use the same parsing code.
In accomplishing this, the commit in question merged not only the
two loops in scan_ident, but all three loops, including the one in
scan_word, by introducing a new function, parse_ident, that the
others call.

One result was that some logic appropriate only to scan_word started
to be applied also to scan_ident; namely, that ::$ would be explicitly
checked for and disallowed (the parsing would stop before the ::), for
the sake of the “Bad name after Foo::” error.

The consequence was that "$foo::$bar" started to be parsed as
$foo."::".$bar, instead of $foo:: . $bar, as previously.

Now, "$foo::@bar" was unaffected, so by fixing one form of inconsis-
tency we ended up form, including B::Deparse bugs (because B::Deparse
was not consistent with the core).

This commit restores the previous behaviour by giving parse_ident an
extra parameter, making the ::$ check optional.

7 years agoUpdate t/porting/customized.dat following Porting/Maintainers.pl updates
Steve Hay [Mon, 27 Jun 2016 13:17:13 +0000 (14:17 +0100)]
Update t/porting/customized.dat following Porting/Maintainers.pl updates

7 years agoPorting/Maintainers.pl - version's vperl/vpp.pm is now excluded
Steve Hay [Mon, 27 Jun 2016 13:06:11 +0000 (14:06 +0100)]
Porting/Maintainers.pl - version's vperl/vpp.pm is now excluded

so the old mapping to cpan/version/lib/version/ is no longer required

7 years agoTest-Simple: Remove files left over from old CPAN releases
Steve Hay [Mon, 27 Jun 2016 13:00:40 +0000 (14:00 +0100)]
Test-Simple: Remove files left over from old CPAN releases

and fix EXCLUDED files list in Porting/Maintainers.pl

7 years agoFix perlpodstyle.pod file name in Porting/Maintainers.pl
Steve Hay [Mon, 27 Jun 2016 12:51:45 +0000 (13:51 +0100)]
Fix perlpodstyle.pod file name in Porting/Maintainers.pl

7 years agoFour Pod-Checker test files have EOL differences compared to CPAN
Steve Hay [Mon, 27 Jun 2016 12:49:01 +0000 (13:49 +0100)]
Four Pod-Checker test files have EOL differences compared to CPAN

(They're all LF only in core but CRLF on CPAN.)

7 years agoModule-Metadata was customized by 9ec93952bf
Steve Hay [Mon, 27 Jun 2016 12:44:04 +0000 (13:44 +0100)]
Module-Metadata was customized by 9ec93952bf

7 years agopp_aelemfast: skip av_fetch() for simple cases
David Mitchell [Sun, 26 Jun 2016 22:13:00 +0000 (23:13 +0100)]
pp_aelemfast: skip av_fetch() for simple cases

Where the av is non magic and has a positive key, try fetching
the array element directly rather than calling av_fetch().

This reduces the number of cycles required to run the nbody benchmark by
about 5%.

7 years agoperlunicode typo
Father Chrysostomos [Sun, 26 Jun 2016 17:57:26 +0000 (10:57 -0700)]
perlunicode  typo

7 years agoUpdate perlunicode
Karl Williamson [Sun, 26 Jun 2016 04:37:38 +0000 (22:37 -0600)]
Update perlunicode

This fixes a couple of nits, but mostly it updates the text to
correspond with changes in Unicode UTS#18, concerning regular
expressions, and Perl compatibility with what it says.

Note that though this Unicode document's text is written as if it were
imposing requirements, it is not technically a part of the Unicode
standard, so its "requirements" are merely suggestions or guidelines.

It turns out that several of the "requirements" that Perl didn't meet
have been retracted by Unicode (as effectively unimplementable), so the
Perl Unicode support is actually better than it appeared, and in fact,
is almost complete at the first 2 (of 3) levels of support discussed in
UTS#18.

7 years agoperlunicode: Fix mistatement
Karl Williamson [Sun, 26 Jun 2016 04:37:21 +0000 (22:37 -0600)]
perlunicode: Fix mistatement

v5.24 reinstated the ability to compile any earlier version of the
Unicode standard into Perl, but this pod did not get updated.

7 years agoSkip EUMM subdirscomplex test on VMS.
Craig A. Berry [Sat, 25 Jun 2016 20:47:43 +0000 (15:47 -0500)]
Skip EUMM subdirscomplex test on VMS.

This tracks the upstream commit at:

https://github.com/Perl-Toolchain-Gang/ExtUtils-MakeMaker/commit/2725f2d850ba1bf545f19317f4407c0909fb16b7

7 years agoperluniprops: Fix pod
Karl Williamson [Wed, 15 Jun 2016 04:22:31 +0000 (22:22 -0600)]
perluniprops: Fix pod

Commit 3d6c5fec8cb3579a30be60177e31058bc31285d7 changed mktables to
change to slightly less nice pod in order to remove a warning that was a
bug in Pod::Checker.  Pod::Checker has now been fixed, and the current
commit reinstates the old pod.

7 years agoperlnewmod: more updates
Lukas Mai [Fri, 24 Jun 2016 08:15:37 +0000 (10:15 +0200)]
perlnewmod: more updates

- hyperlink WWW::Mechanize
- direct to metacpan.org, not search.cpan.org
- changes should go in Changes, not README
- mention 'make distcheck'
- mention 'cpan-upload'
- remove paragraph about announcing to the modules list and registering
  a namespace
- hyperlink some urls

7 years ago[perl #128238] Crash with non-stash in stash
Father Chrysostomos [Fri, 24 Jun 2016 04:57:09 +0000 (21:57 -0700)]
[perl #128238] Crash with non-stash in stash

This is a follow-up to e7acdfe976f.  Even if the name of the stash
entry ends with ::, it may not itself contain a real stash (though
this only happens with code that assigns directly to stash entries,
which has undefined behaviour according to perlmod), so skip hashes
that are not stashes.

7 years agostash.t: Remove tyrone::slothrop
Father Chrysostomos [Fri, 24 Jun 2016 01:23:27 +0000 (18:23 -0700)]
stash.t: Remove tyrone::slothrop

etc.

Leftovers left behind by e35475de.

7 years agoSync CPAN Locale::Maketext 1.27 with blead
Todd Rinaldo [Wed, 22 Jun 2016 23:58:29 +0000 (19:58 -0400)]
Sync CPAN Locale::Maketext 1.27 with blead

7 years agoFix stupid test in 9uninit
Father Chrysostomos [Thu, 23 Jun 2016 22:23:21 +0000 (15:23 -0700)]
Fix stupid test in 9uninit

I was wondering why the warnings were being triggered backwards.
Different output handles.  Duh.

7 years agoPreserve 64-bit array offsets in uninit warnings
Father Chrysostomos [Thu, 23 Jun 2016 20:32:28 +0000 (13:32 -0700)]
Preserve 64-bit array offsets in uninit warnings

This was brought up in ticket #128189.

The main change is that Perl_varname now takes a SSize_t parameter
instead of I32.  I changed various other uses of I32 at the same
time in case some code really does have an array with more than
2**31 entries (or whatever the exact number is).

7 years agosvpeek.t: $? is localized now.
Craig A. Berry [Tue, 21 Jun 2016 02:10:47 +0000 (21:10 -0500)]
svpeek.t: $? is localized now.

So it's no longer upgraded to PVLV on VMS like it would be if it
had magic from COMPLEX_STATUS.

This is a follow-up to b4514920cd5cabcc.

7 years agoModule::CoreList: cut TieHashDelta out of everybody’s life
Aristotle Pagaltzis [Thu, 23 Jun 2016 12:55:47 +0000 (14:55 +0200)]
Module::CoreList: cut TieHashDelta out of everybody’s life

7 years agoModule::CoreList: prepare for better legibility of upcoming patch
Aristotle Pagaltzis [Thu, 23 Jun 2016 12:46:53 +0000 (14:46 +0200)]
Module::CoreList: prepare for better legibility of upcoming patch

7 years agochange manisort to produce a more intuitive order
Yves Orton [Tue, 21 Jun 2016 07:07:48 +0000 (09:07 +0200)]
change manisort to produce a more intuitive order

Dictionary sort order on filenames is very counter-intuitive, and
produces surprising sort orders.

What this patch does is sort things so that the following should
always be true:

1. Case insensitive textual order
   Eg: Foo and foo and FOO should sort together in ascibetical order

2. Shorter dirs go before longer dirs with a common prefix
   Eg: lib/Foo/ should go before lib/Foo-Thing/

3. Base filename goes before dir of the same name
   Eg: lib/Foo.pm should sort before lib/Foo/Bar.pm

This also refactors the MANIFEST sort code in Porting/manisort and
Porting/pod_rules.pm files into Porting/pod_lib.pl

7 years agoChange scalar(%hash) to be the same as 0+keys(%hash)
Yves Orton [Mon, 20 Jun 2016 20:51:38 +0000 (22:51 +0200)]
Change scalar(%hash) to be the same as 0+keys(%hash)

This subject has a long history see [perl #114576] for more discussion.
https://rt.perl.org/Public/Bug/Display.html?id=114576

There are a variety of reasons we want to change the return signature of
scalar(%hash). One is that it leaks implementation details about our
associative array structure. Another is that it requires us to keep track
of the used buckets in the hash, which we use for no other purpose but
for scalar(%hash). Another is that it is just odd. Almost nothing needs to
know these values. Perhaps debugging, but we have several much better
functions for introspecting the internals of a hash.

By changing the return signature we can remove all the logic related
to maintaining and updating xhv_fill_lazy. This should make hot code
paths a little faster, and maybe save some memory for traversed hashes.

In order to provide some form of backwards compatibility we adds three
new functions to the Hash::Util namespace: bucket_ratio(), num_buckets()
and used_buckets(). These functions are actually implemented in
universal.c, and thus always available even if Hash::Util is not loaded.
This simplifies testing. At the same time Hash::Util contains backwards
compatible code so that the new functions are available from it should
they be needed in older perls.

There are many tests in t/op/hash.t that are more or less obsolete after
this patch as they test that xhv_fill_lazy is correctly set in various
situations. However since we have a backwards compat layer we can just
switch them to use bucket_ratio(%hash) instead of scalar(%hash) and keep
the tests, just in case they are actually testing something not tested
elsewhere.

7 years agoAdd a perldelta entry for recursive subpattern screwup in 5.24
Yves Orton [Mon, 20 Jun 2016 20:43:40 +0000 (22:43 +0200)]
Add a perldelta entry for recursive subpattern screwup in 5.24

7 years agoAdd perldelta for POSIX memory leak fix
Yves Orton [Mon, 20 Jun 2016 20:43:11 +0000 (22:43 +0200)]
Add perldelta for POSIX memory leak fix

7 years agoperldelta for Unicode 9.0
Karl Williamson [Tue, 21 Jun 2016 15:39:59 +0000 (09:39 -0600)]
perldelta for Unicode 9.0

7 years agoUse Unicode 9.0
Unicode Consortium [Thu, 9 Jun 2016 22:28:27 +0000 (16:28 -0600)]
Use Unicode 9.0

This includes regenerating the files that depend on the Unicode 9 data
files

7 years agoPrepare for Unicode 9.0
Karl Williamson [Thu, 16 Jun 2016 17:59:24 +0000 (11:59 -0600)]
Prepare for Unicode 9.0

The major code changes needed to support Unicode 9.0 are to changes in
the boundary (break) rules, for things like \b{lb}, \b{wb}.
regen/mk_invlists.pl creates two-dimensional arrays for all these
properties.  To see if a given point in the target string is a break or
not, regexec.c looks up the entry in the property's table whose row
corresponds to the code point before the potential break, and whose
column corresponds to the one after.  Mostly this is completely
determining, but for some cases, extra context is required, and the
array entry indicates this, and there has to be specially crafted code
in regexec.c to handle each such possibility.  When a new release comes
along, mk_invlists.pl has to be changed to handle any new or changed
rules, and regexec.c has to be changed to handle any changes to the
custom code.

Unfortunately this is not a mature area of the Standard, and changes are
fairly common in new releases.  In part, this is because new types of
code points come along, which need new rules.  Sometimes it is because
they realized the previous version didn't work as well as it could.  An
example of the latter is that Unicode now realizes that Regional
Indicator (RI) characters come in pairs, and that one should be able to
break between each pair, but not within a pair.  Previous versions
treated any run of them as unbreakable.  (Regional Indicators are a
fairly recent type that was added to the Standard in 6.0, and things are
still getting shaken out.)

The other main changes to these rules also involve a fairly new type of
character, emojis.  We can expect further changes to these in the next
Unicode releases.

\b{gcb} for the first time, now depends on context (in rarely
encountered cases, like RI's), so the function had to be changed from a
simple table look-up to be more like the functions handling the other
break properties.

Some years ago I revamped mktables in part to try to make it require as
few manual interventions as possible when upgrading to a new version of
Unicode.  For example, a new data file in a release requires telling
mktables about it, but as long as it follows the format of existing
recent files, nothing else need be done to get whatever properties it
describes to be included.

Some of changes to mktables involved guessing, from existing limited
data, what the underlying paradigm for that data was.  The problem with
that is there may not have been a paradigm, just something they did ad
hoc, which can change at will; or I didn't understand their unstated
thinking, and guessed wrong.

Besides the boundary rule changes, the only change that the existing
mktables couldn't cope with was the addition of the Tangut script, whose
character names include the code point, like CJK UNIFIED IDEOGRAPH-3400
has always done.  The paradigm for this wasn't clear, since CJK was the
only script that had this characteristic, and so I hard-coded it into
mktables.  The way Tangut is structured may show that there is a
paradigm emerging (but we only have two examples, and there may not be a
paradigm at all), and so I have guessed one, and changed mktables to
assume this guessed paradigm.  If other scripts like this come along,
and I have guessed correctly, mktables will cope with these
automatically without manual intervention.

7 years agoTell mktables what Unicode version mk_invlist.pl handles
Karl Williamson [Thu, 16 Jun 2016 17:48:28 +0000 (11:48 -0600)]
Tell mktables what Unicode version mk_invlist.pl handles

A downside of supporting the Unicode break properties like \b{gcb},
\b{lb} is that these aren't very mature in the Standard, and so code
likely has to change when updating Perl to support a new version of the
Standard.

And the new rules may not be backwards compatible.  This commit creates
a mechanism to tell mktables the Unicode version that the rules are
written for.  If that is not the same version as being compiled, the
test file marks any failing boundary tests as TODO, and outputs a
warning if the compiled version is later than the code expects, to
alert you to the fact that the code needs to be updated.

7 years agoregexec.c: Add a const to a function parameter
Karl Williamson [Thu, 9 Jun 2016 21:55:39 +0000 (15:55 -0600)]
regexec.c: Add a const to a function parameter

This value isn't changed by the function

7 years agot/re/uniprops.t: Add more description for \b{} tests
Karl Williamson [Thu, 9 Jun 2016 21:35:15 +0000 (15:35 -0600)]
t/re/uniprops.t: Add more description for \b{} tests

mktables generates a file of tests used in t/re/uniprops.t.
The tests furnished by Unicode for the boundaries like \b{gcb} have
comments that indicate the rules each test is testing.  These are useful
in debugging.  This commit changes things so the generated file that
includes these Unicode-supplied tests also has the corresponding
comments which are output as part of the test descriptions.

7 years agoRT now imports new tags automatically
Alex Vandiver [Sat, 21 May 2016 08:21:29 +0000 (01:21 -0700)]
RT now imports new tags automatically

New perl releases are detected via an every-hour cron job, which will
update the relevant custom fields.  This step is thus now unnecessary.

7 years agoSort @def before generating $warnings::DEFAULT.
Matthew Horsfall [Tue, 21 Jun 2016 17:31:37 +0000 (13:31 -0400)]
Sort @def before generating $warnings::DEFAULT.

This makes the comment easier to read.

7 years agoonly treat stash entries with .*:: as sub-stashes
David Mitchell [Tue, 21 Jun 2016 16:06:52 +0000 (17:06 +0100)]
only treat stash entries with  .*:: as sub-stashes

RT #128238

%: = 0 would cause an assertion failure in Perl_gv_check(), since when
it searched a stash for substashes, it assumed anything ending in ':' was
a substash, whereas substashes end in '::'. So check for a double colon
before recursing.

7 years agoRevert "Update Time-HiRes to CPAN version 1.9735"
David Mitchell [Tue, 21 Jun 2016 14:48:57 +0000 (15:48 +0100)]
Revert "Update Time-HiRes to CPAN version 1.9735"

This reverts commit e6da2a9c4c0cecea6bf21f8ae47d78bdbe8bcbce.

This was hanging parallel testing on my Linux box.
Cause not yest investigated, but revert for now.

7 years agouninit warning from $h{\const} coredumped
David Mitchell [Tue, 21 Jun 2016 14:23:20 +0000 (15:23 +0100)]
uninit warning from $h{\const} coredumped

The code that printed the the name and subscript of a hash element
in an "uninitialized variable" warning assumed that a constant
hash subscript would be SvPOK. Something like \1 is a constant,
but is ROK, not POK. SEGVs ensured.

7 years agoUpdate Time-HiRes to CPAN version 1.9735
Chris 'BinGOs' Williams [Tue, 21 Jun 2016 13:59:03 +0000 (14:59 +0100)]
Update Time-HiRes to CPAN version 1.9735

  [DELTA]

1.9735 [2016-07-21]
  - Time::HiRes should override `utime` to allow setting hires
    (use futimens and utimensat to implement subsecond utime)
    [rt.perl.org #114809]
  - the utime patch uses IS_SAFE_PATHNAME() which isn't available in
    too old Perls, so emulate (in case the Devel::PPPort is too old)
  - make it so that only one value is set for -DTIME_HIRES_STAT
    even on systems that support many options

1.9734 [2016-07-17]
  - fix Darwins with clock_gettime: blead 2d41a263
    [rt.perl.org #128427]

7 years agoFix Maintainers.pl after 94e22bd6
Chris 'BinGOs' Williams [Tue, 21 Jun 2016 13:57:44 +0000 (14:57 +0100)]
Fix Maintainers.pl after 94e22bd6

7 years agoCorrect comment in t/porting/manifest.
Matthew Horsfall [Tue, 21 Jun 2016 13:33:24 +0000 (09:33 -0400)]
Correct comment in t/porting/manifest.

There is no 'make manifest' but there is a 'make manisort'.

7 years agoUpdate Devel-PPPort to CPAN version 3.35
Matthew Horsfall [Tue, 21 Jun 2016 12:21:32 +0000 (08:21 -0400)]
Update Devel-PPPort to CPAN version 3.35

    [DELTA]

  3.35 - 2016-06-17

      * Fix compilation in bleadperl by removing a bad test.

  3.34 - 2016-06-04

      * Fix compilation on Windows with certain compilers.
        (__attribute__ not recognized. (#GH 36))

7 years agoPerl_my_vsnprintf: avoid compiler warning
David Mitchell [Tue, 21 Jun 2016 13:22:16 +0000 (14:22 +0100)]
Perl_my_vsnprintf: avoid compiler warning

in the usequadmath branch, gcc is too clever for its own good:

    PERL_UNUSED_ARG(ap);

gives:

util.c:5299:18: warning: ‘sizeof’ on array function parameter ‘ap’ will
return size of ‘__va_list_tag *’ [-Wsizeof-array-argument]

Stick in a void* cast to shut it up.

7 years agoPerlIO-encoding/t/fallback.t: test for warning
David Mitchell [Tue, 21 Jun 2016 12:28:19 +0000 (13:28 +0100)]
PerlIO-encoding/t/fallback.t: test for warning

The previous commit fixed a typo that had been present since this test
script was created: WARN_ON_ERR misspelt as WARN_ON_ERROR.  This means
that one of the tests is now (correctly) issuing a warning.  Rather than
that spilling out onto STDERR, capture it and test it instead.

7 years agoFix Encode constant name usage: WARN_ON_ERROR --> WARN_ON_ERR
Salvador Fandino [Thu, 12 May 2016 12:40:24 +0000 (14:40 +0200)]
Fix Encode constant name usage: WARN_ON_ERROR --> WARN_ON_ERR

7 years ago(perl #128359) prevent a const-ness warning on Cygwin
Tony Cook [Tue, 21 Jun 2016 04:23:16 +0000 (14:23 +1000)]
(perl #128359) prevent a const-ness warning on Cygwin