This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perl5.git
6 years agoEliminate SVrepl_EVAL and SvEVALED()
David Mitchell [Thu, 10 Nov 2016 21:38:30 +0000 (21:38 +0000)]
Eliminate SVrepl_EVAL and SvEVALED()

This flag is only used to indicate that the SV holding the text of the
replacement part of a s/// has seen at least one /e.

Instead, set the IVX field in the SV to a true value.
(We already set the NVX field on that SV to indicate a multi-src-line
substitution).

This is to reduce the number of odd special cases for the SVpbm_VALID flag.

6 years agoremove DOES's usage of SvSCREAM
David Mitchell [Thu, 10 Nov 2016 20:44:16 +0000 (20:44 +0000)]
remove DOES's usage of SvSCREAM

Currently the SvSCREAM flag is set on a temporary SV whose string value
is "isa", but where for the purposes of printing

    Can't call method "XXX"

its name is treated as "DOES" rather than "isa".

Instead, set the temp SV's PVX buffer to point to a special static
string (PL_isa_DOES) whose value is "isa", but the where the error
reporting code can compare the address with PL_isa_DOES and if so, print
"DOES" instead.

This is to reduce the number of odd special cases for the SvSCREAM flag.

6 years agoremove eval's usage of SvSCREAM
David Mitchell [Thu, 10 Nov 2016 14:44:10 +0000 (14:44 +0000)]
remove eval's usage of SvSCREAM

Currently the SvSCREAM flag is set on the sv pointed to by
cx->blk_eval.cur_text, to indicate that it is ref counted.

Instead, use a spare bit in the blk_u16 field of the eval context.
This is to reduce the number of odd special cases for the SvSCREAM flag.

6 years agoop_dump() - remove extra indentation from PMOP
David Mitchell [Sat, 12 Nov 2016 08:05:53 +0000 (08:05 +0000)]
op_dump() - remove extra indentation from PMOP

When dumping a PMOP, it displays the PMOP-specific fields with
an extra set of braces and level of indentation, e.g.

    {
        TYPE = match  ===> 1
        FLAGS = (VOID,SLABBED)
        PRIVATE = (RTIME)
        {
            PMf_PRE /abc/ (RUNTIME)
            PMFLAGS = (SCANFIRST,ALL)
        }
    }

This is visually confusing, because child ops are shown in the same way.
This commit removes the extra indentation:

    {
        TYPE = match  ===> 1
        FLAGS = (VOID,SLABBED)
        PRIVATE = (RTIME)
        PMf_PRE /abc/ (RUNTIME)
        PMFLAGS = (SCANFIRST,ALL)
    }

6 years agoperlguts: add pTHX_ to magic method examples
David Mitchell [Thu, 10 Nov 2016 13:58:36 +0000 (13:58 +0000)]
perlguts: add pTHX_ to magic method examples

These functions all take an interpreter arg these days.

6 years agodump.c: don't display an ARRAY's ARYLEN field
David Mitchell [Thu, 10 Nov 2016 13:52:23 +0000 (13:52 +0000)]
dump.c: don't display an ARRAY's ARYLEN field

Originally xav_arylen was an AV field and was displayed by sv_dump.
In 2005, this ield was removed, and replaced by PERL_MAGIC_arylen_p
magic when needed.

A side effect of this is that sv_dump on a magical AV adds
PERL_MAGIC_arylen_p magic to the av as a side-effect.
Which is undesirable.

This commit just omits displaying 'ARYLEN =' altogether. Any arylen magic
will already be displayed as part of dumping the AV, so it's redundant.

6 years agoTest2: __LINE__ and (caller)[2] may be different under Data::Dumper
Aaron Crane [Sat, 12 Nov 2016 15:06:51 +0000 (16:06 +0100)]
Test2: __LINE__ and (caller)[2] may be different under Data::Dumper

The __LINE__ token is compiled as an op_const pointing to an SvPV containing
the stringification of the line number. But (caller)[2] yields an SvIV that
directly represents the line number.

Data::Dumper now uses its XS implementation by default, even when its
Deparse option is enabled; previously, Deparse forced use of the pure-Perl
implementation.

The XS and pure-Perl implementations of Data::Dumper differ slightly: the
pure-Perl implementation always dumps defined non-reference scalars with
quotes, while the XS implementation uses a quote-less representation for
small integers. (The precise differences have changed over time, however.)

Test-Simple/t/Test2/modules/API/Context.t uses the minimal testing library
in Test-Simple/t/tools.pl to test itself, and t/tools.pl in turn implements
is_deeply() by doing the equivalent of is(Dumper($got), Dumper($expected)).
Finally, it does is_deeply() on structures containing a line number, but the
"got" structure contains the result of (caller)[2], while the "expected"
structure contains __LINE__. So now that the dumps of those structures are
different, the test fails.

Fix this by doing arithmetic on the __LINE__, thus forcing it to be an IV.

6 years agot/op/caller.t: add a TODO test for RT #129239
Lukas Mai [Fri, 21 Oct 2016 13:18:38 +0000 (15:18 +0200)]
t/op/caller.t: add a TODO test for RT #129239

6 years agot/op/sub.t: add a TODO test for RT #129916
Lukas Mai [Fri, 21 Oct 2016 13:04:39 +0000 (15:04 +0200)]
t/op/sub.t: add a TODO test for RT #129916

6 years agoReduce verbosity of "make install.man"
Aaron Crane [Sat, 12 Nov 2016 12:55:50 +0000 (13:55 +0100)]
Reduce verbosity of "make install.man"

Previously, two progress messages were emitted for each manpage: one by
installman itself, and one by the function in install_lib.pl that it calls
to actually install the file. Disabling the second of those in each case
saves over 750 lines of unhelpful output.

6 years ago(perl #128295) don't treat -Dprefix=/usr as special
Tony Cook [Wed, 15 Jun 2016 05:02:48 +0000 (15:02 +1000)]
(perl #128295) don't treat -Dprefix=/usr as special

but instead require an extra option -Ddarwin_distribution to produce
the same results.

6 years agoUse CLOCK_REALTIME in clock_nanosleep check
Dagfinn Ilmari Mannsåker [Thu, 20 Oct 2016 14:23:07 +0000 (15:23 +0100)]
Use CLOCK_REALTIME in clock_nanosleep check

For consistency with the other checks that use CLOCK_* constants.

6 years agoFix up includes in Time-HiRes Makefile.PL checks
Dagfinn Ilmari Mannsåker [Thu, 20 Oct 2016 14:17:46 +0000 (15:17 +0100)]
Fix up includes in Time-HiRes Makefile.PL checks

This aligns the includes with what the POSIX, Linux and FreeBSD manpages
say they should be.

6 years agoUse clockid_t throughout in Time::HiRes
Dagfinn Ilmari Mannsåker [Mon, 17 Oct 2016 10:39:56 +0000 (11:39 +0100)]
Use clockid_t throughout in Time::HiRes

Commit 69d1f2c2 makes clockid_t available on all platforms, so use that
for function arguments throughout instead of casting in the
clock_gettime() calls.

This particularly needs smoking with C++ on platforms that provide
clock_gettime but not clockid_t.

6 years agoskip Net::Ping UDP on HP-UX
H.Merijn Brand [Sat, 12 Nov 2016 11:42:40 +0000 (12:42 +0100)]
skip Net::Ping UDP on HP-UX

6 years agoData::Dumper: the XS implementation now supports Deparse
Aaron Crane [Mon, 11 Jul 2016 14:25:43 +0000 (15:25 +0100)]
Data::Dumper: the XS implementation now supports Deparse

This will provide a significant performance enhancement for callers that
use deparsing (including Data::Dumper::Concise).

There are no longer any configuration settings or (when run on Perl
5.21.10 or later) platforms that force use of the pure-Perl
implementation.

6 years agoData::Dumper: delete spurious /e flag on substitution
Aaron Crane [Mon, 11 Jul 2016 13:58:59 +0000 (14:58 +0100)]
Data::Dumper: delete spurious /e flag on substitution

6 years agoop.c: clarify documentation for Perl_load_module()
Aaron Crane [Mon, 11 Jul 2016 14:19:39 +0000 (15:19 +0100)]
op.c: clarify documentation for Perl_load_module()

6 years agoChange hv_fetch(…, "…", …, …) to hv_fetchs(…, "…", …)
Dagfinn Ilmari Mannsåker [Sat, 12 Nov 2016 10:47:48 +0000 (11:47 +0100)]
Change hv_fetch(…, "…", …, …) to hv_fetchs(…, "…", …)

The dual-life dists all use Devel::PPPort, so they can use this function
even though it was only added in 5.10.

6 years agogenen. sorry
H.Merijn Brand [Sat, 12 Nov 2016 10:09:23 +0000 (11:09 +0100)]
genen. sorry

6 years agoNo default breaks win32 and VMS
H.Merijn Brand [Sat, 12 Nov 2016 09:53:40 +0000 (10:53 +0100)]
No default breaks win32 and VMS

6 years agoRT 130010: add regression test.
James E Keenan [Thu, 10 Nov 2016 01:56:15 +0000 (20:56 -0500)]
RT 130010: add regression test.

6 years agoPATCH: [perl #130010] a5540cf breaks texinfo
Karl Williamson [Wed, 9 Nov 2016 20:55:41 +0000 (21:55 +0100)]
PATCH: [perl #130010] a5540cf breaks texinfo

When a regular expression is compiled that contains user-defined
properties, the subroutine the user must furnish to implement those
properties may not yet be defined.  To cope with this possibility, the
regex pattern compiler stores the name and package of the subroutine,
and this is to be expanded the first time the property is actually used
during execution.  Once expanded, the property should be immutable, and
so the scalar containing the expansion is marked read-only.  It turns
out that prior to the blamed commit, that read-only-ness was being
bypassed in some instances simply by freeing the scalar, replaced by a
new one.  The commit changed that.  The pattern may contain components
both known at compile time, and deferred until runtime.  The two are
combined at the time of expansion, but that was now running afoul of the
read-only setting.  This commit simply turns off the read-only flag at
the time of expansion, and it's turned on again afterwards.

The next commit will add a test.

6 years agoutf8.c: Add comment
Karl Williamson [Sat, 12 Nov 2016 08:00:08 +0000 (09:00 +0100)]
utf8.c: Add comment

6 years agoAllow "." to be excluded from @INC
H.Merijn Brand [Fri, 11 Nov 2016 22:18:51 +0000 (23:18 +0100)]
Allow "." to be excluded from @INC

Build with -Ddefault_inc_excludes_dot to have exclude . from @INC.
The *current* default is set to be effectively no change. A future change
will most likely revert the default to the safer exclusion of .

6 years agoUse \w instead of obscure character range
Dagfinn Ilmari Mannsåker [Fri, 11 Nov 2016 17:25:15 +0000 (18:25 +0100)]
Use \w instead of obscure character range

6 years agot/porting/regen.t: try to be more helpful when tests fail
Aaron Crane [Fri, 11 Nov 2016 16:51:17 +0000 (17:51 +0100)]
t/porting/regen.t: try to be more helpful when tests fail

A few of the regen scripts can't be run automatically, for one reason or
another. When regen.t encounters a mismatch corresponding to one of those
scripts, it now tells the porter that the script must be run manually. This
seems more useful than the previous behaviour of merely announcing a
mismatch that "make regen" won't be able to fix.

6 years agoMove Unicode-Normalize to dist/
Karl Williamson [Fri, 11 Nov 2016 13:52:39 +0000 (14:52 +0100)]
Move Unicode-Normalize to dist/

p5p has taken over the maintenance of this module, so it should be in
dist/

6 years agoRegen from the "special" regen scripts
Aaron Crane [Fri, 11 Nov 2016 16:39:32 +0000 (17:39 +0100)]
Regen from the "special" regen scripts

A few regen scripts aren't run by "make regen", either because they depend
on an external tool, or they must be run by the Perl just built. So they
must be run manually.

6 years agoTest for correct state of . in @INC
Dagfinn Ilmari Mannsåker [Fri, 11 Nov 2016 15:47:11 +0000 (16:47 +0100)]
Test for correct state of . in @INC

6 years agoFix list parenthesisation
Aaron Crane [Fri, 11 Nov 2016 15:13:00 +0000 (16:13 +0100)]
Fix list parenthesisation

6 years agoPush current state to work on failing tests
H.Merijn Brand [Fri, 11 Nov 2016 15:39:03 +0000 (16:39 +0100)]
Push current state to work on failing tests

6 years agoPatch unit tests to explicitly insert "." into @INC when needed.
H.Merijn Brand [Sat, 22 Oct 2016 11:55:48 +0000 (13:55 +0200)]
Patch unit tests to explicitly insert "." into @INC when needed.

require calls now require ./ to be prepended to the file since . is no
longer guaranteed to be in @INC.

6 years agoRemove "." from default @INC when default_inc_excludes_dot is set
H.Merijn Brand [Sat, 22 Oct 2016 11:46:08 +0000 (13:46 +0200)]
Remove "." from default @INC when default_inc_excludes_dot is set

Perl now provides a way to build perl without . in @INC by default. If you want
this feature, you can build with -Ddefault_inc_excludes_dot

Because the testing / make process for perl modules do not function well
with . missing from @INC, Perl now supports the environment variable
PERL_USE_UNSAFE_INC=1 which makes Perl behave as it previously did,
returning . to @INC in all child processes.

WARNING: PERL_USE_UNSAFE_INC has been provided during the perl 5.25 development
cycle and is not guaranteed to function in perl 5.26.

Update unit tests and default value files to work with the new %Config
variable "default_inc_excludes_dot"

6 years agoDe-dup the output of git ls-files
H.Merijn Brand [Fri, 11 Nov 2016 15:23:05 +0000 (16:23 +0100)]
De-dup the output of git ls-files

Depending on the state of your git folder, some files can appear twice or
more in the output of git ls-files

6 years agolocale.c: Add missing STATIC
Karl Williamson [Fri, 11 Nov 2016 15:03:07 +0000 (16:03 +0100)]
locale.c: Add missing STATIC

6 years agoErrno: mention that using %! autoloads Errno (RT #119359)
Lukas Mai [Mon, 19 Aug 2013 05:07:17 +0000 (07:07 +0200)]
Errno: mention that using %! autoloads Errno (RT #119359)

Also use lexical filehandles/3-arg open in example.

6 years agoRegen uconfig.h
Aaron Crane [Fri, 11 Nov 2016 14:56:08 +0000 (15:56 +0100)]
Regen uconfig.h

6 years agoRe-gen after backport with serious fixes
H.Merijn Brand [Fri, 11 Nov 2016 14:04:59 +0000 (15:04 +0100)]
Re-gen after backport with serious fixes

6 years agoRMG: suggest a simpler way of reviewing perlhist changes
Aaron Crane [Fri, 11 Nov 2016 11:01:24 +0000 (12:01 +0100)]
RMG: suggest a simpler way of reviewing perlhist changes

6 years agoRMG: break a list over multiple lines
Aaron Crane [Fri, 11 Nov 2016 10:54:52 +0000 (11:54 +0100)]
RMG: break a list over multiple lines

I found these three similar filenames hard to read when flowed into a single
paragraph.

6 years agomake 'do' errors refer to 'do' (not 'require') (RT #129927)
Lukas Mai [Fri, 11 Nov 2016 10:43:03 +0000 (11:43 +0100)]
make 'do' errors refer to 'do' (not 'require') (RT #129927)

6 years agoDrop support for Linux a.out
Aaron Crane [Fri, 11 Nov 2016 10:20:14 +0000 (11:20 +0100)]
Drop support for Linux a.out

Linux has used ELF for over twenty years.

6 years agoUpgrade Unicode-Collate from version 1.17 to 1.18
Steve Hay [Wed, 9 Nov 2016 13:26:47 +0000 (13:26 +0000)]
Upgrade Unicode-Collate from version 1.17 to 1.18

6 years agoUpgrade Math::BigInt from vesion 1.999726(_01) to 1.999727
Steve Hay [Wed, 9 Nov 2016 13:18:28 +0000 (13:18 +0000)]
Upgrade Math::BigInt from vesion 1.999726(_01) to 1.999727

This includes the blead customization.

6 years agoPerl_do_vop(): enhance "avoid sv_catpvn"
David Mitchell [Wed, 9 Nov 2016 11:50:35 +0000 (11:50 +0000)]
Perl_do_vop(): enhance "avoid sv_catpvn"

TonyC's recent commit v5.25.6-172-gdc529e6 updated do_vop() to avoid
doing a sv_catpvn() when the left and destination SVs are the same.
As well as being more efficient, it is needed, as a recent change to
sv_catpvn() made it more likely to grow and realloc the buffer, meaning
the copy()'s src buffer had been freed.

This commit represents my parallel attempt to fix the same issue; I'm
replacing Tony's version with mine as it is logically more comprehensive:
it copes with the dest being the same as the right arg as well as the
left, and checks for string pointers being equal rather than sv's being
equal. Neither of these make any difference currently, but they could in
theory (although unlikely) catch some future change in usage.

RT #129995

6 years agohandle SvIMMORTALs in LHS of list assign
David Mitchell [Tue, 8 Nov 2016 12:26:12 +0000 (12:26 +0000)]
handle SvIMMORTALs in LHS of list assign

RT #129991: this code fails an assert that the LHS is not SvIMMORTAL:

    perl -e  '($_,$0)=(1,0) for 0 gt 0'

The 'set SVf_BREAK flag in a mark and sweep' code I wrote to look for
common elements, skips PL_sv_undef on the LHS. It should also skip
other SvIMMORTAL SVs like PL_sv_yes, but the SvIMMORTAL() test is
more expensive than a simple (sv == &PL_sv_undef), and I couldn't think of
a case where a LHS would be immortal but not sv_undef.

So I added an assert instead.

The above code shows that it was in fact possible, so test for SvIMMORTAL
instead.

6 years agoStefan Seifert is now a perl author
Tony Cook [Wed, 9 Nov 2016 03:59:38 +0000 (14:59 +1100)]
Stefan Seifert is now a perl author

6 years agoclarify the contents of argv[]
Stefan Seifert [Wed, 9 Nov 2016 03:49:07 +0000 (14:49 +1100)]
clarify the contents of argv[]

6 years agoskip some tests that aren't UTF-EBCIDIC compatible on non-ASCII
Tony Cook [Wed, 9 Nov 2016 03:16:21 +0000 (14:16 +1100)]
skip some tests that aren't UTF-EBCIDIC compatible on non-ASCII

6 years ago(perl #129000) use the new utf8_hop_back()
Tony Cook [Wed, 9 Nov 2016 03:09:23 +0000 (14:09 +1100)]
(perl #129000) use the new utf8_hop_back()

when reporting unrecognized characters in UTF mode.

6 years ago(perl #129000) create a safer utf8_hop()
Tony Cook [Mon, 31 Oct 2016 03:28:34 +0000 (14:28 +1100)]
(perl #129000) create a safer utf8_hop()

Unlike utf8_hop(), utf8_hop_safe() won't navigate before the
beginning or after the end of the supplied buffer.

The original version of this put all of the logic into
utf8_hop_safe(), but in many cases a caller specifically
needs to go forward or backward, and supplying the other limit
made the function less usable, so I split the function
into forward and backward cases.

This split may also make inlining these functions more efficient
or more likely.

6 years agoUpgrade podlators from version 4.08 to 4.09
Steve Hay [Tue, 8 Nov 2016 14:02:01 +0000 (14:02 +0000)]
Upgrade podlators from version 4.08 to 4.09

6 years agoUpdate Archive-Tar to CPAN version 2.18
Chris 'BinGOs' Williams [Mon, 7 Nov 2016 13:29:13 +0000 (13:29 +0000)]
Update Archive-Tar to CPAN version 2.18

  [DELTA]

2.18  07/11/2016 (JHI)
- Capture also the STDERR when checking tar exe

2.16  01/11/2016 (JHI && CBERRY)
- Make roundtrip tar exe finding robust for crappy tars

6 years agoperlvar: clarify @ISA recommendations
Aristotle Pagaltzis [Mon, 7 Nov 2016 08:03:11 +0000 (09:03 +0100)]
perlvar: clarify @ISA recommendations

6 years agoperlvar: document @ISA
Hauke D [Tue, 1 Nov 2016 11:53:38 +0000 (12:53 +0100)]
perlvar: document @ISA

It was documented in a few other places but not in perlvar.

6 years agoperlobj: do not discourage manual @ISA
Aristotle Pagaltzis [Mon, 7 Nov 2016 07:51:51 +0000 (08:51 +0100)]
perlobj: do not discourage manual @ISA

6 years agoperlobj: remove now-inaccurate claim
Aristotle Pagaltzis [Mon, 7 Nov 2016 07:36:25 +0000 (08:36 +0100)]
perlobj: remove now-inaccurate claim

6 years ago(perl #129995) avoid sv_catpvn() in do_vop() when unneeded
Tony Cook [Mon, 7 Nov 2016 00:22:55 +0000 (11:22 +1100)]
(perl #129995) avoid sv_catpvn() in do_vop() when unneeded

This could call sv_catpvn() with the source string being within the
destination SV, which caused a freed memory access if do_vop() and
sv_catpvn_flags() had different ideas about the ideal size of the
target SV's buffer.

6 years agoAdded note about perlobj change to perldelta
Dave Rolsky [Tue, 1 Nov 2016 19:34:03 +0000 (14:34 -0500)]
Added note about perlobj change to perldelta

6 years agoAdd docs on calling methods using a fully qualified name like $mp3->File::save()
Lukas Mai [Tue, 1 Nov 2016 19:25:21 +0000 (14:25 -0500)]
Add docs on calling methods using a fully qualified name like $mp3->File::save()

6 years agoSmall formatting fix in perlobj
Dave Rolsky [Tue, 1 Nov 2016 19:24:45 +0000 (14:24 -0500)]
Small formatting fix in perlobj

6 years agoAdd a few more mentions of Moo to perlootut
Dave Rolsky [Tue, 1 Nov 2016 19:21:44 +0000 (14:21 -0500)]
Add a few more mentions of Moo to perlootut

Also ran Porting/podtidy which reformatted a few lines.

6 years agoutf8.c: No need to look at trailing NUL in comparing string
Karl Williamson [Sun, 6 Nov 2016 01:05:41 +0000 (02:05 +0100)]
utf8.c: No need to look at trailing NUL in comparing string

I meant to get this into commit
b0b342d4b3fa61880a96b645a3dab648f7c4c682, but didn't.  Subtract 1 from
the sizeof a constant string to get the number of bytes to compare, as
we don't need to look at the trailing NUL.

6 years agocustomized.dat regen
Jarkko Hietaniemi [Sat, 5 Nov 2016 23:01:49 +0000 (19:01 -0400)]
customized.dat regen

6 years agoVersion bump
Jarkko Hietaniemi [Sat, 5 Nov 2016 23:01:35 +0000 (19:01 -0400)]
Version bump

6 years agoCapture also the stderr, the message from tar might go there
Jarkko Hietaniemi [Sat, 5 Nov 2016 22:58:51 +0000 (18:58 -0400)]
Capture also the stderr, the message from tar might go there

Follow-up to 202b0c8a3ba3de0efe5cb730b242b8c0502e1add

6 years agonetbsd-vax: no infinity
Jarkko Hietaniemi [Sat, 5 Nov 2016 18:10:56 +0000 (14:10 -0400)]
netbsd-vax: no infinity

The tests were not failing, but being a bit noisy.

6 years agocall AV set magic in list assign
David Mitchell [Fri, 4 Nov 2016 15:42:37 +0000 (15:42 +0000)]
call AV set magic in list assign

RT #129996

Perl used to do this, but I broke it with my recent commit
v5.25.6-78-g8b0c337.

Normally if @a has set magic, then that magic gets called for each
av_store() call; e.g. in @a = (1,2,3), the magic should get called 3
times.

I broke that because I was checking for SVs_RMG rather than SVs_SMG, and
it so happens that no core code sets SVs_SMG on an AV without setting
SVs_RMG too. However, code such as Tk (which use PERL_MAGIC_ext magic),
does.

This commit re-instates the AV behaviour.

Oddly enough, hv_store_ent() etc *don't* call HV set magic. I've added
some tests for that, but marked them TODO because I'm not sure what the
correct behaviour should be.

6 years agonetbsd-vax: customized.dat update for S-L-U
Jarkko Hietaniemi [Fri, 4 Nov 2016 12:52:46 +0000 (08:52 -0400)]
netbsd-vax: customized.dat update for S-L-U

6 years agonetbsd-vax: also the 1E1000 is toxic (in compiletime).
Jarkko Hietaniemi [Fri, 4 Nov 2016 12:43:40 +0000 (08:43 -0400)]
netbsd-vax: also the 1E1000 is toxic (in compiletime).

6 years agoconfigure.com: missing ELSE in usethreads logic
Craig A. Berry [Fri, 4 Nov 2016 01:17:36 +0000 (20:17 -0500)]
configure.com: missing ELSE in usethreads logic

This would only bite if an unknown compiler had been selected, but
there is a port of clang in progress, so try to be ready for
anything.

6 years agoFix typos in test comment
Dagfinn Ilmari Mannsåker [Thu, 3 Nov 2016 13:53:45 +0000 (13:53 +0000)]
Fix typos in test comment

6 years agoCompiler choice clean-up in configure.com.
Craig A. Berry [Thu, 3 Nov 2016 13:15:47 +0000 (08:15 -0500)]
Compiler choice clean-up in configure.com.

VAXC has not been a possibility for a good long while, and the
versions of the DEC/Compaq/HP/VSI C compiler that report themselves
as "DEC" in a listing file are 15 years or more out-of-date and
can be safely desupported.

6 years agoskip SEGVing test in t/uni/overload.t
David Mitchell [Thu, 3 Nov 2016 11:20:50 +0000 (11:20 +0000)]
skip SEGVing test in t/uni/overload.t

This TODO test is expected to SEGV, and is run using fresh_perl().
But that doesn't stop the shell issuing this scary noise to STDERR:

    sh: line 1:  5106 Segmentation fault      (core dumped) /home/davem/perl5/gi
t/bleed/perl "-I../lib" "tmp5097A" 2>&1

So until this is fixed, just skip the test. See [perl #129933]

6 years agoNet::Ping 500_ping_icmp.t: remove sudo code
David Mitchell [Thu, 3 Nov 2016 11:06:25 +0000 (11:06 +0000)]
Net::Ping 500_ping_icmp.t: remove sudo code

Rcently this  test scipt had code added to it to attempt to re-run itself
as root by invoking 'sudo' rather rather than just skipping the ICMP ping
test.

This can the side-effects of:

* sudo sending a security alert email to the local root account;

* a script being run as root when a non-root user invokes 'make test',
  which might be considered antisocial;

* noise on stderr about sudo failing.

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

This commit just removes the sudo code and doesn't try to do anything
clever.

6 years agoMake toke.c:S_lop's x arg a U8 to match PL_expect
Andy Lester [Thu, 3 Nov 2016 10:54:36 +0000 (10:54 +0000)]
Make toke.c:S_lop's x arg a U8 to match PL_expect

The second argument to S_lop() is an int, but it gets stored in
PL_expect which is a U8.  If we need a U8, then let's bring it
into the function as a U8.

6 years agofix hv.h build breakage
David Mitchell [Thu, 3 Nov 2016 10:32:33 +0000 (10:32 +0000)]
fix hv.h build breakage

The previous commit had a double closing comment (*/)

6 years agoadd a comment about the properties of struct hek
Yves Orton [Thu, 3 Nov 2016 09:03:26 +0000 (10:03 +0100)]
add a comment about the properties of struct hek

6 years agoRevert "hv.h: rework HEK_FLAGS to a proper member in struct hek"
Tony Cook [Thu, 3 Nov 2016 00:12:57 +0000 (11:12 +1100)]
Revert "hv.h: rework HEK_FLAGS to a proper member in struct hek"

This reverts commit d3148f758506efd28325dfd8e1b698385133f0cd.

SV keys are stored as pointers in the key_key, on platforms with
alignment requirements (such as PA-RISC) this resulted in bus errors
early in the build.

6 years agoFix wrong UTF-8 overflow error on 32-bit platforms
Karl Williamson [Wed, 2 Nov 2016 04:12:51 +0000 (22:12 -0600)]
Fix wrong UTF-8 overflow error on 32-bit platforms

Commit 2b5e7bc2e60b4c4b5d87aa66e066363d9dce7930 changed the algorithm
for detecting overflow during decoding UTF-8 into code points.  However,
on 32-bit platforms, this change caused it to claim some things overflow
that really don't.  ALl such are overlong malformations, which are
normally forbidden, but not necessarily.  This commit fixes that.

6 years agoAPItest/t/utf8.t: Correct to uppercase in print
Karl Williamson [Wed, 2 Nov 2016 04:13:21 +0000 (22:13 -0600)]
APItest/t/utf8.t: Correct to uppercase in print

This worked so long as we didn't have hex digits A-F.

6 years agomacOS (10.12) deprecated syscall(2).
Jarkko Hietaniemi [Wed, 2 Nov 2016 20:49:52 +0000 (16:49 -0400)]
macOS (10.12) deprecated syscall(2).

6 years agofix taint handling in list assignment
David Mitchell [Wed, 2 Nov 2016 16:05:54 +0000 (16:05 +0000)]
fix taint handling in list assignment

My recent commit v5.25.6-79-gb09ed99 reworked list assignment, and
accidentally broke taint handling at the same time.

The basic idea is that each element is independent; in:

    ($a, $b, ...) = ($tainted, $untainted, ...);

$a should end up tainted, $b should end up untainted, the statement
containing the assign should remain untainted, and if the statement was
already tainted it shouldn't affect the assign.

Surprisingly this is completely untested, which is why I failed to spot it
when I broke it.

Now fixed. In fact in addition I spotted something that had always been
broken, and fixed that too: it was tainting the rest of the statement; in:

    (($a) = ($TAINT. "x")), ($b = $b . "x");

The taint in the list assign to $a was lingering to mess up and taint $b.

Prior to v5.25.6-79-gb09ed99 , pp_assign looked roughly like:

    for (...each lhs elem...) {
        TAINT_NOT;
        switch (lhs type) {
        case scalar:
            assign a value to lhs;
            break;
        case SVt_PVAV:
            av_clear();
            for (...each rhs elem...)
                sv = newSV(0);
                sv_setsv(sv, rhs_elem);
                av_store(av, i, sv);
                TAINT_NOT;
            }
            break;
        }
        case SVt_PVHV:
            ...similarly...
    }

Commit v5.25.6-79-gb09ed99 accidentally removed *all* the TAINT_NOT's.

This commit re-adds the first TAINT_NOT, but doesn't re-add the
per-array/hash TAINT_NOT's, on the grounds that the aggregates are first
emptied, so any elements being assigned to will be fresh and can't have
taint magic attached, so calling mg_set() on them won't set the taint
value to 1 even if PL_tainted is set.

But this commit does add an extra TAINT_NOT *after* the outer loop, which
is what I think is fixing a longstanding bug.

6 years ago[perl #130001] h2xs: avoid infinite loop for enums
Hugo van der Sanden [Fri, 28 Oct 2016 12:27:23 +0000 (13:27 +0100)]
[perl #130001] h2xs: avoid infinite loop for enums

'typedef enum x { ... } x' causes h2xs to enter a substitution loop while
trying to write the typemap file.

6 years agoclarify behavior single quote regexps
Yves Orton [Wed, 2 Nov 2016 09:53:18 +0000 (10:53 +0100)]
clarify behavior single quote regexps

The documentation was ambiguous about what type of interpolation
was disabled in single quote regexps. It is a bit debateable whether
"\n" in a regex is a regexp meta-escapes which happens to match "\n",
or if it is a string escape that needs to be interpolated. Since single
quote regexps should allow regexp meta-escapes (for instance \s), then
it makes more sense to treat \n and \x{..} also as regexp meta-escapes,
which then leaves nothing but variables that /could/ be interpolated.

This effectively officially defines the current behavior as correct,
and will allow us to close a number of tickets because of it. In
particular we can close #21491 as "not a bug", and probably also related
tickets.

6 years agoUpgrade Net::Ping from version 2.51 to 2.55
Steve Hay [Wed, 2 Nov 2016 08:18:01 +0000 (08:18 +0000)]
Upgrade Net::Ping from version 2.51 to 2.55

(This retains the blead customizations from 01b515d1d7 and 0fc44d0a18.)

6 years agoTreat VSI C the same as DEC/Compaq/HP C.
Craig A. Berry [Wed, 2 Nov 2016 00:06:06 +0000 (19:06 -0500)]
Treat VSI C the same as DEC/Compaq/HP C.

6 years agoUpgrade Unicode::Collate from version 1.14 to 1.17
Steve Hay [Tue, 1 Nov 2016 17:44:52 +0000 (17:44 +0000)]
Upgrade Unicode::Collate from version 1.14 to 1.17

6 years agoUpgrade Test::Simple from version 1.302059 to 1.302062
Steve Hay [Tue, 1 Nov 2016 17:35:01 +0000 (17:35 +0000)]
Upgrade Test::Simple from version 1.302059 to 1.302062

6 years agoUpgrade Term::ANSIColor from version 4.05 to 4.06
Steve Hay [Tue, 1 Nov 2016 17:29:33 +0000 (17:29 +0000)]
Upgrade Term::ANSIColor from version 4.05 to 4.06

6 years agorework perl #129903 - inf recursion from use of empty pattern in regex codeblock
Yves Orton [Mon, 31 Oct 2016 19:22:37 +0000 (20:22 +0100)]
rework perl #129903 - inf recursion from use of empty pattern in regex codeblock

FC didn't like my previous patch for this issue, so here is the
one he likes better. With tests and etc. :-)

The basic problem is that code like this: /(?{ s!!! })/ can trigger
infinite recursion on the C stack (not the normal perl stack) when the
last successful pattern in scope is itself. Since the C stack overflows
this manifests as an untrappable error/segfault, which then kills perl.

We avoid the segfault by simply forbidding the use of the empty pattern
when it would resolve to the currently executing pattern.

I imagine with a bit of effort someone can trigger the original SEGV,
unlike my original fix which forbade use of the empty pattern in a
regex code block. So if someone actually reports such a bug we might
have to revert to the older approach of prohibiting this.

6 years agonew feature @{^CAPTURE} (and %{^CAPTURE} and %{^CAPTURE_ALL})
Yves Orton [Mon, 31 Oct 2016 21:44:31 +0000 (22:44 +0100)]
new feature @{^CAPTURE} (and %{^CAPTURE} and %{^CAPTURE_ALL})

@{^CAPTURE} exposes the capture buffers of the last match
as an array. So $1 is ${^CAPTURE}[0].

%{^CAPTURE} is the equivalent to %+ (ie named captures)

%{^CAPTURE_ALL} is the equivalent to %- (ie all named captures).

6 years agoSkip the subnormals tests in tru64.
Jarkko Hietaniemi [Tue, 1 Nov 2016 00:45:03 +0000 (20:45 -0400)]
Skip the subnormals tests in tru64.

At first I thought these would be ftz/daz problems
(flush-to-zero/denormals-are-zero), compiled with bare cc those seem
to happen with denormals (e.g. DBL_MIN * 0.5), but the "cc -ieee"
which perl is compiled with does make the ftz/daz go away.  Needs
further study.  So make them TODO for now.

6 years ago(perl #129085) avoid memcmp() past the end of a string
Tony Cook [Mon, 29 Aug 2016 05:04:55 +0000 (15:04 +1000)]
(perl #129085) avoid memcmp() past the end of a string

When a match is anchored against the start of a string, the regexp
can be compiled to include a fixed string match against a fixed
offset in the string.

In some cases, where the matched against string included UTF-8 before
the fixed offset, this could result in attempting a memcmp() which
overlaps the end of the string and potentially past the end of the
allocated memory.

6 years ago(perl #128997) avoid reading beyond the end of the line buffer
Tony Cook [Tue, 18 Oct 2016 04:46:48 +0000 (15:46 +1100)]
(perl #128997) avoid reading beyond the end of the line buffer

when there's a short UTF-8 character at the end.

6 years ago(perl #129961) code cleanup for clang -Weverything support
Andy Lester [Mon, 31 Oct 2016 00:35:40 +0000 (11:35 +1100)]
(perl #129961) code cleanup for clang -Weverything support

This patch simplifies two bits of code that I came across while
working on supporting the clang -Weverything flag.

The first, in Perl_validate_proto, removes unnecessary variable
initialization if proto of NULL is passed.

The second, in S_scan_const, rearranges some code and #ifdefs so that
the convert_unicode and real_range_max variables are only declared
if EBCDIC is set.  This lets us no longer have to unnecessarily set
useless variables to make the compiler happy, and it saves us from some
unnecessary checks on "if (convert_unicode)".  One of the comments says
"(Compilers should optimize this out for non-EBCDIC)", but now the
compiler won't even see these unnecessary variables or tests.

6 years agoAdded some discussion of tabs & spaces in the source code
Andy Lester [Sun, 30 Oct 2016 23:46:30 +0000 (10:46 +1100)]
Added some discussion of tabs & spaces in the source code

6 years agofix #129802: sv_grow: remove the overallocation for COW exemption for powers of 2
Yves Orton [Sun, 30 Oct 2016 10:02:57 +0000 (11:02 +0100)]
fix #129802: sv_grow: remove the overallocation for COW exemption for powers of 2

They are just performance bombs waiting to hit the regex engine
and other code. If someone wants this precise level of management
then we should provide an API for them to do so.

Really this just shows the flaw in our current COW implementation.

6 years agofix perl #129802 - overallocate in concat to ensure we can COW
Yves Orton [Sun, 30 Oct 2016 09:56:36 +0000 (10:56 +0100)]
fix perl #129802 - overallocate in concat to ensure we can COW

Otherwise we get degenerate performance in things like the regex
engine under certain cases.