This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perl5.git
7 years agoIncrease $Filter::Simple::VERSION to 0.93
Father Chrysostomos [Fri, 26 Aug 2016 13:37:05 +0000 (06:37 -0700)]
Increase $Filter::Simple::VERSION to 0.93

7 years ago[perl #107726] Filter::Simple: ‘use’ and then ‘no’
Ricardo SIGNES [Fri, 26 Aug 2016 13:36:09 +0000 (06:36 -0700)]
[perl #107726] Filter::Simple: ‘use’ and then ‘no’

Filter::Simple was erroneously signalling eof if it encountered a
‘no MyFilter’ right after ‘use’:

use MyFilter;
no MyFilter;

In this case it should simply not filter anything.

The reason for the bug was that the ‘while ($status = filter_read())’
loop in Filter::Simple::gen_filter_import was not incrementing $count
(a variable used basically as a boolean to remember whether we are
still getting input from the file) when finding the terminator (no
MyFilter).  So it would conclude after the loop that the file had come
to an end and simply return 0.

[Commit message written by the committer.]

7 years ago[perl #107726] Test for Filter::Simple and ‘no’
Father Chrysostomos [Fri, 26 Aug 2016 13:20:05 +0000 (06:20 -0700)]
[perl #107726] Test for Filter::Simple and ‘no’

use MyFilter;
no MyFilter;

does not work.  A fix is forthcoming.

7 years agoperlinterp.pod: Expand the op tree section
Father Chrysostomos [Thu, 11 Aug 2016 06:43:34 +0000 (23:43 -0700)]
perlinterp.pod: Expand the op tree section

based on things that came up in the thread starting at
<20160808225325.79944d95@shy.leonerd.org.uk>.

7 years agoRemove VMS-specific hacks from showlex.t.
Craig A. Berry [Fri, 26 Aug 2016 02:09:01 +0000 (21:09 -0500)]
Remove VMS-specific hacks from showlex.t.

I added this 15 years ago in d0c1fe9a9931bc27, but it isn't
necessary for any VMS version now supported and it has recently
caused the test to start failing under the test suite but not
when run individually.  So just get rid of it.

7 years agolocale.c: Use my_strlcat()
Karl Williamson [Tue, 23 Aug 2016 19:32:05 +0000 (13:32 -0600)]
locale.c: Use my_strlcat()

strcat() is safe in this context, but some compilers were optimizing
this to strcpy() causing a porting test to fail that looks for unsafe
code.  Rather than fighting this, just use my_strlcat().  The code is
rarely executed.  But at the same time, I used the return value of that
function to know where to start the next cat in the next loop iteration
without having to have the cat code search for the trailing NUL.

7 years agoperlapi: Document returns from my_strlcat, my_strlcpy
Karl Williamson [Tue, 23 Aug 2016 19:30:45 +0000 (13:30 -0600)]
perlapi: Document returns from my_strlcat, my_strlcpy

7 years agoPATCH: [perl #129072]: podspec typo
Karl Williamson [Thu, 25 Aug 2016 16:23:21 +0000 (10:23 -0600)]
PATCH: [perl #129072]: podspec typo

7 years agoPerl_deb_stack_all() - handle CXt_SUBST better
David Mitchell [Wed, 24 Aug 2016 15:28:00 +0000 (16:28 +0100)]
Perl_deb_stack_all() - handle CXt_SUBST better

RT #129029

There's a loop which skips CXt_SUBST context entries - but it
wasn't checking that the *current* cx is that type, but instead
was always checking the base cx and was effectively a noop

Also fixup a few code comments in that function.

7 years agorestore Internals::hv_clear_placeholders for now
Yves Orton [Thu, 25 Aug 2016 10:03:42 +0000 (12:03 +0200)]
restore Internals::hv_clear_placeholders for now

7 years agotmp fix for Bleadperl breaks Variable-Magic
David Mitchell [Wed, 24 Aug 2016 12:57:56 +0000 (13:57 +0100)]
tmp fix for Bleadperl breaks Variable-Magic

RT #128989

Prior to my commit v5.25.3-266-g1d7e644, in the absence of the SVs_RMG
flag, av_fetch() used AvFILL() for -ve keys and AvFILLp() for positive
keys. That commit changed it so they both use AvFILLp. This has broken
Variable::Magic 0.59.

As an interim measure, restore the old behaviour.

7 years agoconcise.t: work with PERL_UNICODE=""
David Mitchell [Wed, 24 Aug 2016 12:41:00 +0000 (13:41 +0100)]
concise.t: work with PERL_UNICODE=""

Fixup some tests I added recently so that they pass with PERL_UNICODE=""
- which causes extra hints bits to be set in nextstate ops.

7 years agore_untuit_start() avoid overshoot with utf8
David Mitchell [Wed, 24 Aug 2016 12:21:04 +0000 (13:21 +0100)]
re_untuit_start() avoid overshoot with utf8

RT #129012

re_untuit_start() is run before doing a "proper" regex match, to either
quickly reject a match or to find the earliest position in a string where
the match could occur. Part of its action is to search within the string
for a known substring which forms a part of the pattern.

If that substring is utf8, with multiple bytes per character, then
the calculation of the highest point in the string where its worth
searching for the substring, could overshoot the end of the string.

It's a (mostly) harmless issue, since apart from the issue of reading a
few bytes beyond the end of a string (which might cause a problem if the
string is memory mapped for example), the only concern is that in theory
(although extremely unlikely) a spurious match for a substring could be
found partly beyond the end of the string, resulting in the full RE engine
being called to (correctly) do the match, when otherwise the match could
have been more quickly rejected.

7 years agotweaks for Win32 VC vs GCC detection makefile code
Daniel Dragan [Mon, 15 Aug 2016 21:00:18 +0000 (17:00 -0400)]
tweaks for Win32 VC vs GCC detection makefile code

-fix issue that CCHOME depends on CCTYPE, which in auto detect mode is
 set after CCHOME so CCHOME uses uninit CCTYPE var
-also fix else vs .ELSE in makefile.mk

7 years agopodcheck.t: Show file name in stderr output
Father Chrysostomos [Tue, 23 Aug 2016 13:27:27 +0000 (06:27 -0700)]
podcheck.t: Show file name in stderr output

So that one does not have to re-run it by hand to find out which
file failed.

7 years agoUpdate that Module-CoreList in Maintainers.pl
Chris 'BinGOs' Williams [Sat, 20 Aug 2016 21:41:55 +0000 (22:41 +0100)]
Update that Module-CoreList in Maintainers.pl

7 years agoPrepare Module-CoreList for v5.25.5
Chris 'BinGOs' Williams [Sat, 20 Aug 2016 21:18:35 +0000 (22:18 +0100)]
Prepare Module-CoreList for v5.25.5

7 years agoBump the perl version in various places for v5.25.5
Chris 'BinGOs' Williams [Sat, 20 Aug 2016 21:07:30 +0000 (22:07 +0100)]
Bump the perl version in various places for v5.25.5

7 years agoNew perldelta
Chris 'BinGOs' Williams [Sat, 20 Aug 2016 21:00:26 +0000 (22:00 +0100)]
New perldelta

7 years agoUpdate epigraphs for v5.25.4
Chris 'BinGOs' Williams [Sat, 20 Aug 2016 20:52:01 +0000 (21:52 +0100)]
Update epigraphs for v5.25.4

7 years agoUpdate perlhist v5.25.4
Chris 'BinGOs' Williams [Sat, 20 Aug 2016 18:40:51 +0000 (19:40 +0100)]
Update perlhist

7 years agoFinalise perldelta
Chris 'BinGOs' Williams [Sat, 20 Aug 2016 18:30:25 +0000 (19:30 +0100)]
Finalise perldelta

7 years agoUpdate Module::CoreList
Chris 'BinGOs' Williams [Sat, 20 Aug 2016 17:43:02 +0000 (18:43 +0100)]
Update Module::CoreList

7 years agoUpdate release date in Module::CoreList
Chris 'BinGOs' Williams [Sat, 20 Aug 2016 17:35:26 +0000 (18:35 +0100)]
Update release date in Module::CoreList

7 years agoperldelta documentation section
Chris 'BinGOs' Williams [Sat, 20 Aug 2016 15:58:31 +0000 (16:58 +0100)]
perldelta documentation section

7 years agoperldelta updates
Chris 'BinGOs' Williams [Sat, 20 Aug 2016 15:52:44 +0000 (16:52 +0100)]
perldelta updates

7 years agoUpdate ExtUtils-MakeMaker to CPAN version 7.24
Chris 'BinGOs' Williams [Sat, 20 Aug 2016 12:39:12 +0000 (13:39 +0100)]
Update ExtUtils-MakeMaker to CPAN version 7.24

  [DELTA]

7.24  Sat Aug 20 13:22:28 BST 2016

    No changes since 7.23_01

7.23_01 Fri Aug 19 10:02:30 BST 2016

    Test fixes:
    - always use the core serializers when testing in core

7 years agopodcheck.t: Send helpful error output to stderr
Father Chrysostomos [Sat, 20 Aug 2016 05:22:21 +0000 (22:22 -0700)]
podcheck.t: Send helpful error output to stderr

While we do try to keep stderr clean for tests, that is for *passing*
tests.  If the diagnostic output goes to stdout instead, then nobody
gets to see it for ‘make test’, which means that the script has to
be re-run by itself just to find out what failed.  Since this is a
long-running test, that is quite inconvenient.

Also mention which .t the output is coming from.

7 years agoperldelta for #128951 / bf8a9a15
Father Chrysostomos [Sat, 20 Aug 2016 05:10:57 +0000 (22:10 -0700)]
perldelta for #128951 / bf8a9a15

7 years agoCorrect a perldelta entry
Father Chrysostomos [Sat, 20 Aug 2016 05:08:14 +0000 (22:08 -0700)]
Correct a perldelta entry

The termcode variable in scan_const, which was an I32 and susceptible
to truncation, is not used to find the closing delimiter, but only to
check for special uses of delimiters such as in qr'...' and m?...? and
‘<’ which is used internally as the ‘closing delimiter’ for here-docs,
it being one that can never occur for other pyoq operators.

Hence, such strings already worked before, but now they work consis-
tently; \x{100000027} no longer suppresses regexep interpolation,
for instance.

7 years agoalways use the core serializers in EUMM for core tests
Karen Etheridge [Thu, 18 Aug 2016 19:47:41 +0000 (12:47 -0700)]
always use the core serializers in EUMM for core tests

7 years agoregenerate META.* using new CPAN::Meta, and always use the core serializers
Karen Etheridge [Thu, 18 Aug 2016 18:35:11 +0000 (11:35 -0700)]
regenerate META.* using new CPAN::Meta, and always use the core serializers

7 years agoChanges manually performed for one file.
Karen Etheridge [Fri, 19 Aug 2016 23:24:49 +0000 (19:24 -0400)]
Changes manually performed for one file.

cpan/CPAN-Meta/Lib/CPAN/Meta.pm was being very naughty when it came to being
the target of 'git am'.  As committer, I extracted the diff for that file from
the patch supplied by the author and attempted to apply it via 'git apply'.
Still no luck.  Hence, I manually edited the source file.

For: RT #128987

7 years agoManually remove file recalcitrant to 'git am'.
James E Keenan [Fri, 19 Aug 2016 23:45:33 +0000 (19:45 -0400)]
Manually remove file recalcitrant to 'git am'.

7 years agoUpgrade CPAN-Meta from 2.150005 -> 2.150010 (Parse-CPAN-Meta now combined into this...
Karen Etheridge [Thu, 18 Aug 2016 17:14:00 +0000 (10:14 -0700)]
Upgrade CPAN-Meta from 2.150005 -> 2.150010 (Parse-CPAN-Meta now combined into this distribution)

    2.150010  2016-08-18 12:10:08-04:00 America/New_York

      [FIXED]

      - the YAML and JSON backend variables are ignored when building/testing the
        perl core itself, where non-core backends are not yet installed.

      [CHANGED]

      - Added "use warnings" to Parse::CPAN::Meta

    2.150009  2016-07-02 21:07:49-04:00 America/New_York (TRIAL RELEASE)

      [FIXED]

      - Fixed used of Encode in Parse::CPAN::Meta::load_json_string
        (Cherry picked from Parse::CPAN::Meta 1.4422)

    2.150008  2016-06-28 17:01:03-04:00 America/New_York (TRIAL RELEASE)

      [ADDED]

      - Merged Parse::CPAN::Meta 1.4420 into this distribution

    2.150007  2016-06-28 03:48:16-04:00 America/New_York (TRIAL RELEASE)

      [FIXED]

      - The cloning routine would raise an error on expected types when it
        previously would stringify.  The old behavior is restored.

    2.150006  2016-06-23 20:05:46-04:00 America/New_York (TRIAL RELEASE)

      [FIXED]

      - CPAN::Meta::Prereqs now fully accepts phases and types starting with 'x_'.
        New 'phases' and 'types_in' interfaces have been added.

      - No longer relies on JSON backend for data structure cloning. This is
        much faster than using JSON::PP.

      [TESTS]

      - The 'extra_mappings' feature for meta merging is now tested and
        documented.

      - During tests, delete new environment variables added by
        Parse::CPAN::Meta 1.4418

      [SPEC]

      - Clarifies acceptable values for booleans

      - Cleaned up text and links of historical specs.

7 years agoperldelta: Updates for 5.24
Karl Williamson [Fri, 19 Aug 2016 20:17:42 +0000 (14:17 -0600)]
perldelta: Updates for 5.24

This constitutes the changes that khw made that he thinks warrant
mention in perldelta.

7 years agoEncode: revert commit that introduces security holes
Karl Williamson [Fri, 19 Aug 2016 20:07:53 +0000 (14:07 -0600)]
Encode: revert commit that introduces security holes

This reverts a portion of commit
0f33e03c7e91f63bcd07b5ddfc00101715fa1fc0 which introduces some security
holes in checking for UTF-8 malformations.  In particular, it allows
overflow in non-strict mode, and overlongs in either mode.

See discussion at https://github.com/dankogai/p5-encode/issues/64

This reversion is to make sure that we don't release even a development
version with known security holes.  A final disposition is still to be
determined

7 years agoDo not show error message if errno = 0 for flush fail on STDOUT
H.Merijn Brand [Fri, 19 Aug 2016 18:44:14 +0000 (20:44 +0200)]
Do not show error message if errno = 0 for flush fail on STDOUT

Somehow (on HP-UX Itanium) the flush fails, but errno is still 0
The lib/warnings.t test then shows

EXPECTED:
Filehandle STDOUT opened only for output at - line 3.
GOT:
Filehandle STDOUT opened only for output at - line 3.
Unable to flush stdout: Error 0

This change suppresses that last line if errno is (still) 0

7 years agoav_fetch(): remove check for freed SV
David Mitchell [Fri, 19 Aug 2016 10:39:20 +0000 (11:39 +0100)]
av_fetch(): remove check for freed SV

Currently av_fetch() has this extra test:

    if (AvREIFY(av) && SvIS_FREED(AvARRAY(av)[key])) {
        /* eg. @_ could have freed elts */
        AvARRAY(av)[key] = NULL;        /* 1/2 reify */

which basically says that if the array has the reify flag set (typically
only @_ has this) and if the element being retrieved in it has been freed,
then replace it with an undef value instead.

This can be triggered with code like:

    sub f {
        $r = 0;
        my $var = $_[0];
    }

    $r = do { my $x; \$x };
    f($$r);

which leaves $var as undef rather than causing a "panic: attempt to copy
freed scalar".

However, code like

    my ($var) = @_;

*won't* get handled specially, and will still trigger the panic.

It was added in 1996 as a result of this thread:

    From: Andreas Koenig <k@anna.in-berlin.de>
    Subject: SEGV with $_[0] and circular references
    Message-Id: <199608131528.RAA25965@anna.in-berlin.de>

That was in the context of getting a SEGV - whereas now we get the
"panic: attempt to copy freed scalar" instead.

It was agreed in this thread that it could be removed:

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

7 years agoConcise: improve hints decoding
David Mitchell [Fri, 19 Aug 2016 10:30:47 +0000 (11:30 +0100)]
Concise: improve hints decoding

Include the missing HINT_UNI_8_BIT (as 'us'), decode the feature bundle
bits (as fea=7) and display any unrecognised bits in hex rather than
decimal.

This changes a nextstate following 'use feature "signatures"' from, to

    2     <;> nextstate(...) v:%,{,469762048 ->3
    2     <;> nextstate(...) v:%,{,fea=7 ->3

7 years agoConcise: use hex for some large constants
David Mitchell [Fri, 19 Aug 2016 08:04:52 +0000 (09:04 +0100)]
Concise: use hex for some large constants

7 years agotoke.c: Introduce peekspace()
Father Chrysostomos [Fri, 19 Aug 2016 05:27:42 +0000 (22:27 -0700)]
toke.c: Introduce peekspace()

This should make the sites that use LEX_NO_INCLINE a bit less arcane.
This has nothing to do with the erstwhile PEEKSPACE macro that existed
for MADness’ sake.

7 years agotoke.c: Note retval of S_skipspace
Father Chrysostomos [Fri, 19 Aug 2016 05:23:45 +0000 (22:23 -0700)]
toke.c: Note retval of S_skipspace

7 years agotoke.c: Move skipspace closer to S_skipspace
Father Chrysostomos [Fri, 19 Aug 2016 05:22:25 +0000 (22:22 -0700)]
toke.c: Move skipspace closer to S_skipspace

It was added back in 21791330a when we still had MADness.  Back then
there were about four skipspace functions, some of them before
S_update_debugger_info and some after, and I just put the #define
before all of them.  But now the only skipspace function left is
after S_update_debugger_info, so having the #define before it just
makes it harder to see what’s what.

7 years ago[perl #128951] Fix ASan error with @{\327
Father Chrysostomos [Thu, 18 Aug 2016 05:32:23 +0000 (22:32 -0700)]
[perl #128951] Fix ASan error with @{\327

By \327 I mean character number 327 in octal.

Without memory tools like ASan, it produces garbled output.  The added
test fails like this:

# Failed test 18 - @ { \327 \n - used to garble output (or fail asan) [perl \#128951] at ./test.pl line 1058
#      got "Unrecognized character \\xD7; marked by <-- HERE after \x{a0}\x{f6}@3\x{a8}\x{7f}\000\000@{<-- HERE near column -1 at - line 1."
# expected "Unrecognized character \\xD7; marked by <-- HERE after @{<-- HERE near column 3 at - line 1."

Dave Mitchell’s explanation from the RT ticket:
> The src code contains the bytes:
>
>     @ { \327 \n
>
> after seeing "@{" the lexer calls scan_ident(), which sees the \327 as an
> ident, then calls S_skipspace_flags() to skip the spaces following the
> ident.  This moves the current cursor position to the \n, and since that's
> a line boundary, its updates PL_linestart and PL_bufptr to point to \n
> too.
>
> When it finds that the next char isn't a '}', it does this:
>
>             /* Didn't find the closing } at the point we expected, so restore
>                state such that the next thing to process is the opening { and */
>      s = SvPVX(PL_linestr) + bracket; /* let the parser handle it */
>
> i.e. it moves s back to the "{\317" then continues.
>
> However, PL_linestart doesn't get reset, so later when the parser
> encounters the \327 and tries to croak with "Unrecognized character %s ...",
> when it prints out the section of src code in error, since s < PL_linestr,
> negative string lengths and ASAN errors ensue.

This commit fixes it by passing the LEX_NO_INCLINE flag (added by
21791330a), which specifies that we are not trying to read past the
newline but simply peek ahead.  In that case lex_read_space does not
reset PL_linestart.

But that does cause problems with code like:

${;
#line 3

}

because we end up jumping ahead via skipspace without updating the
line number.  So we need to do a skipspace_flags(..., LEX_NO_INCLINE)
first (i.e., peek ahead), and then when we know we don’t need to go
back again we can skipspace(...) for real.

7 years agoperldelta for the many hexfp fixes.
Jarkko Hietaniemi [Thu, 18 Aug 2016 23:19:17 +0000 (19:19 -0400)]
perldelta for the many hexfp fixes.

7 years agomagic-27839.t miniperl fix-up
Father Chrysostomos [Thu, 18 Aug 2016 23:40:54 +0000 (16:40 -0700)]
magic-27839.t miniperl fix-up

7 years agoincfilter.t miniperl fix-up
Father Chrysostomos [Thu, 18 Aug 2016 23:40:12 +0000 (16:40 -0700)]
incfilter.t miniperl fix-up

7 years agohash-rt85026.t miniperl fix-up
Father Chrysostomos [Thu, 18 Aug 2016 23:39:27 +0000 (16:39 -0700)]
hash-rt85026.t miniperl fix-up

7 years agogroups.t miniperl fix-up
Father Chrysostomos [Thu, 18 Aug 2016 23:38:44 +0000 (16:38 -0700)]
groups.t miniperl fix-up

7 years agogetpid.t miniperl fix-up
Father Chrysostomos [Thu, 18 Aug 2016 22:42:36 +0000 (15:42 -0700)]
getpid.t miniperl fix-up

7 years agodump.t miniperl fix-up
Father Chrysostomos [Thu, 18 Aug 2016 22:40:59 +0000 (15:40 -0700)]
dump.t miniperl fix-up

7 years agopat_advanced.t miniperl fix-up
Father Chrysostomos [Thu, 18 Aug 2016 22:40:18 +0000 (15:40 -0700)]
pat_advanced.t miniperl fix-up

7 years agoeintr.t miniperl fix-up
Father Chrysostomos [Thu, 18 Aug 2016 22:39:32 +0000 (15:39 -0700)]
eintr.t miniperl fix-up

7 years agosignatures: eliminate XSIGVAR, add KEY_sigvar
David Mitchell [Thu, 18 Aug 2016 08:53:11 +0000 (09:53 +0100)]
signatures: eliminate XSIGVAR, add KEY_sigvar

When I moved subroutine signature processing into perly.y with
v5.25.3-101-gd3d9da4, I added a new lexer PL_expect state, XSIGVAR.

This indicated, when about to parse a variable, that it was a signature
element rather than a my variable; in particular, it makes ($,...)
be toked as the lone sigil '$' rather than the punctuation variable '$,'.

However this is a bit heavy-handled; so instead this commit adds a
new allowed pseudo-keyword value to PL_in_my: as well as KEY_my, KEY_our and
KEY_state, it can now be KEY_sigvar. This is a less intrusive change
to the lexer.

7 years agoRevert threads-dirh.t part of 624c42e21
Father Chrysostomos [Thu, 18 Aug 2016 02:47:20 +0000 (19:47 -0700)]
Revert threads-dirh.t part of 624c42e21

async needs to be imported from threads.pm at compile time for
async { ... } to compile correctly.

7 years agoTest data mistake was masked by mistaken fractional matching
Jarkko Hietaniemi [Mon, 15 Aug 2016 21:49:51 +0000 (17:49 -0400)]
Test data mistake was masked by mistaken fractional matching

(Affected only double-double.)

7 years agoDo not deploy the fractional matching without fractions
Jarkko Hietaniemi [Mon, 15 Aug 2016 21:52:17 +0000 (17:52 -0400)]
Do not deploy the fractional matching without fractions

7 years agoTest subnormals with quadmath
Jarkko Hietaniemi [Thu, 18 Aug 2016 01:37:07 +0000 (21:37 -0400)]
Test subnormals with quadmath

7 years agoDefine Perl_fp_class() for quadmath
Jarkko Hietaniemi [Thu, 18 Aug 2016 01:16:16 +0000 (21:16 -0400)]
Define Perl_fp_class() for quadmath

More importantly, define Perl_fp_class_denorm()
so that hexfp subnormals work with printf %a.

7 years agoHandle subnormals of x86 80-bit
Jarkko Hietaniemi [Mon, 15 Aug 2016 02:52:40 +0000 (22:52 -0400)]
Handle subnormals of x86 80-bit

7 years agoUse library testing for subnormality
Jarkko Hietaniemi [Sun, 14 Aug 2016 23:59:32 +0000 (19:59 -0400)]
Use library testing for subnormality

...instead of implementing it brokenly

Continuing work on rt.perl.org #128843

7 years agoUse set_up_inc for several unit tests
Nicolas R [Thu, 18 Aug 2016 01:14:51 +0000 (11:14 +1000)]
Use set_up_inc for several unit tests

Use set_up_inc when require.pl is loaded
move plan outside of BEGIN block
when no tests are run at BEGIN time.

Using set_up_inc allow to run these tests under minitest
but also compile them using B::C.

This also has the advantage to use a single
control point for @INC setup.

Note: some tests cannot use 'require test.pl',
unshfit is then used for them.

7 years ago(perl #128954) improved hints for Hurd
Pino Toscano [Thu, 18 Aug 2016 00:05:36 +0000 (10:05 +1000)]
(perl #128954) improved hints for Hurd

(a) This enables the malloc wrap also on Hurd, as used on Linux
already; Perl's own test suite passed with it, and I see no reason to
diverge from the behaviour on Linux and kFreeBSD. I'm not sure whether
it affects the ABI though, so it might be safe only for the upcoming
perl 5.24 in experimental (since that breaks the ABI anyway)

(b) This improves the reporting of the GNU libc used, so it's shown in
`perl -V` (as libc value, instead of the currently empty string).

7 years agoutf8.c: Remove an EBCDIC-only path
Karl Williamson [Thu, 11 Aug 2016 23:43:13 +0000 (17:43 -0600)]
utf8.c: Remove an EBCDIC-only path

Rewriting this slightly allows an #ifdef EBCDIC to be removed.

I am copying from code written by pali@cpan.org and included in the
Encode distribution.

7 years agoregexec.c: White-space only
Karl Williamson [Thu, 11 Aug 2016 22:53:58 +0000 (16:53 -0600)]
regexec.c: White-space only

7 years agolib/locale.t: Add some extra info to a debug statement
Karl Williamson [Thu, 11 Aug 2016 22:53:35 +0000 (16:53 -0600)]
lib/locale.t: Add some extra info to a debug statement

7 years agolib/locale.t: Generalize test
Karl Williamson [Thu, 11 Aug 2016 22:49:57 +0000 (16:49 -0600)]
lib/locale.t: Generalize test

To test for cased letters, we need to include lower as well as upper,
folded.  I happen to know that internally currently, this doesn't make a
difference, but the test should still be written so it will work
properly if that were to change.

7 years agoTake advantage of SvGROW's return value
Karl Williamson [Thu, 11 Aug 2016 22:42:20 +0000 (16:42 -0600)]
Take advantage of SvGROW's return value

I had not realized that SvGROW returned the new string pointer.  Using
that makes a one-step process from a two-step process.

I examined the code for other possible occurrences, and found others
where it seemed that the two-step seemed clearer, so left those alone.

7 years agoUpgrade Time::Local from version 1.2300 to 1.24
Steve Hay [Wed, 17 Aug 2016 12:42:39 +0000 (13:42 +0100)]
Upgrade Time::Local from version 1.2300 to 1.24

7 years agoUpgrade Test::Simple from version 1.302049 to 1.302052
Steve Hay [Wed, 17 Aug 2016 12:38:12 +0000 (13:38 +0100)]
Upgrade Test::Simple from version 1.302049 to 1.302052

7 years agoUpgrade HTTP::Tiny from version 0.058_001 to 0.064
Steve Hay [Wed, 17 Aug 2016 12:34:12 +0000 (13:34 +0100)]
Upgrade HTTP::Tiny from version 0.058_001 to 0.064

7 years agoUpgrade File::Fetch from version 0.50 to 0.52
Steve Hay [Wed, 17 Aug 2016 12:27:05 +0000 (13:27 +0100)]
Upgrade File::Fetch from version 0.50 to 0.52

7 years agoRemove dead code in pp.c:pp_index
Father Chrysostomos [Wed, 17 Aug 2016 05:15:01 +0000 (22:15 -0700)]
Remove dead code in pp.c:pp_index

8df0e7a28b changed

/* One needs to be upgraded.  */
if (little_utf8) {

to

/* One needs to be upgraded.  */
if (little_utf8 && !IN_ENCODING) {

The ‘else’ branch of that ‘if’ has some code conditional on
little_utf8 being true, which could only happen before in the case of
PL_encoding being set, and which cannot happen any more.

7 years agoperldelta for #126482 / c82de78e3ba
Father Chrysostomos [Tue, 16 Aug 2016 18:25:03 +0000 (11:25 -0700)]
perldelta for #126482 / c82de78e3ba

7 years agoTest that the lexer does not upgrade constants
Father Chrysostomos [Tue, 16 Aug 2016 18:22:46 +0000 (11:22 -0700)]
Test that the lexer does not upgrade constants

Make sure that if two barewords occur in a row the lexer does not
upgrade the corresponding symbol table entries into full GVs.

c82de78e was a bug fix, but it also made things more efficient.
Test that we do not lose that efficiency by mistake.

7 years agoMove a recently-added test
Father Chrysostomos [Tue, 16 Aug 2016 18:14:51 +0000 (11:14 -0700)]
Move a recently-added test

It’s not really a method test (no method call is involved, but a check
to see whether the code might compile to a method call), but a lexer
test.

7 years agoav_fetch(): use less branches.
David Mitchell [Wed, 17 Aug 2016 11:06:27 +0000 (12:06 +0100)]
av_fetch(): use less branches.

The code that handles negative array indexes and out-of-bounds
negative indices used to require:

    2 conditions for a +ve index
    3 conditions for a -ve index

After this commit, for the common case where the index is in bounds,
it requires a single condition regardless of sign. For the less common
case of out-of-bounds, it requires 2 conditions.

Also, the one condition is more branch-predict friendly - it's whether
the index is in bounds or not. Previously the first test was whether
key < 0, and in code that does mixed signs, such as $a[0] + $a[-1],
branch prediction could be tricky.

It achieves this at the expense of a more complex expression for the key.

7 years agoav_fetch(): sprinkle UNLIKELY()
David Mitchell [Wed, 17 Aug 2016 10:18:46 +0000 (11:18 +0100)]
av_fetch(): sprinkle UNLIKELY()

7 years agoav_fetch(): optimise the negative index branch.
David Mitchell [Wed, 17 Aug 2016 08:59:06 +0000 (09:59 +0100)]
av_fetch(): optimise the negative index branch.

For a negative index one conditional is redundant, since after determining
that key < 0 and recomputing key as (AvFILLp(av) - key), key can't
be > AvFILLp(av).

7 years agoav_fetch(): use AvFILLp rather than AvFILL
David Mitchell [Wed, 17 Aug 2016 08:52:48 +0000 (09:52 +0100)]
av_fetch(): use AvFILLp rather than AvFILL

The point in the code which uses AvFILL will never be reached if the array
is tied, so use AvFILLp insead, which directly accesses the xav_fill
field.

This only affects the $a[-N] branch: the $a[+N] branch already uses
AvFILLp().

7 years agoCoverity CID #152143: annotate switch fallthru.
Jarkko Hietaniemi [Wed, 17 Aug 2016 11:18:03 +0000 (07:18 -0400)]
Coverity CID #152143: annotate switch fallthru.

7 years agoav_fetch(): remove redundant condition
David Mitchell [Wed, 17 Aug 2016 08:01:44 +0000 (09:01 +0100)]
av_fetch(): remove redundant condition

At the point of testing for !AvARRAY(av)[key] if AvREIFY(av), it's already
been confirmed that the array element isn't null.

7 years agoadd any_op field to the ANY savestack union
David Mitchell [Wed, 17 Aug 2016 06:52:57 +0000 (07:52 +0100)]
add any_op field to the ANY savestack union

This is an attempt to silence a (probably spurious) Coverity warning.

7 years agoThe 48c0e89d broke minitest by unconditional use Hash::Util.
Jarkko Hietaniemi [Wed, 17 Aug 2016 01:56:43 +0000 (21:56 -0400)]
The 48c0e89d broke minitest by unconditional use Hash::Util.

7 years agoperldelta for dd1dbff0
Jarkko Hietaniemi [Wed, 17 Aug 2016 00:34:49 +0000 (20:34 -0400)]
perldelta for dd1dbff0

7 years agoCoverity CID #15149: Missing varargs init or cleanup
Jarkko Hietaniemi [Tue, 16 Aug 2016 23:15:50 +0000 (19:15 -0400)]
Coverity CID #15149: Missing varargs init or cleanup

The return was returning after va_start but before va_end.

7 years agoRevert "Check against negative uid/gid for fchown()."
Jarkko Hietaniemi [Tue, 16 Aug 2016 23:06:31 +0000 (19:06 -0400)]
Revert "Check against negative uid/gid for fchown()."

This reverts commit f95ba548a286b17c260cc168715a9d0d441b14a6.

[rt.perl.org #128967]

The negative arguments to fchown depend on the platform,
so Coverity should not claim it knows what is acceptable.

7 years ago[perl #126482] Fix assert fail ‘a_const a_const’
Father Chrysostomos [Tue, 16 Aug 2016 01:09:17 +0000 (18:09 -0700)]
[perl #126482] Fix assert fail ‘a_const a_const’

Mentioning a constant twice in a row results in an assertion failure:

$ ./miniperl -e 'sub ub(){0} ub ub'
Assertion failed: (SvTYPE(cv) == SVt_PVCV || SvTYPE(cv) == SVt_PVFM), function Perl_cv_const_sv_or_av, file op.c, line 7926.
Abort trap: 6

A bisect points to 2eaf799e7, but I don’t understand why that commit
introduced it.  I suspect it was failing an assertion for a slightly
different reason back then, but am too lazy to check.

In any case, it fails now because, while ‘ub ub’ is being compiled,
when the sub is looked up initially (in toke.c:yylex), we call
rv2cv_op_cv with the RV2GVOPCV_RETURN_STUB flag, which allows a
bare constant ref to be returned.  So the ‘cv’ variable contains
an RV (\0):

    cv = lex
? isGV(gv)
    ? GvCV(gv)
    : SvROK(gv) && SvTYPE(SvRV(gv)) == SVt_PVCV
? (CV *)SvRV(gv)
: ((CV *)gv)
: rv2cv_op_cv(rv2cv_op, RV2CVOPCV_RETURN_STUB);

(‘ub’ here is a constant 0, which is stored in the symbol table as
\0; i.e., ‘sub ub(){0}’ is equivalent to ‘BEGIN { $::{ub} = \0 }’.)

Then if we see a word immediately following it (the second ‘ub’) we
check a little further down to see whether it might be a method call.
That entails calling intuit_method, which does this:

indirgv = gv_fetchpvn_flags(tmpbuf, len, ( UTF ? SVf_UTF8 : 0 ), SVt_PVCV);
if (indirgv && GvCVu(indirgv))
    return 0;

So we are looking to see whether the second word refers to a sub and
deciding this is not an indirect method call if there is a sub.

But calling gv_fetchpvn_flags like that has the effect of upgrading
the symbol table entry to a full GV.  Since the ‘cv’ variable in yylex
points to that symbol table entry, it ends up pointing to a GV, which
certain code later on does not expect to happen.

So we should pass the GV_NOADD_NOINIT flag to gv_fetchpvn_flags to
prevent lookup of the second bareword from upgrading the entry (we
already do that earlier in intuit_method for the first bareword).  We
only check the GV to see whether it has a sub or io thingy in it any-
way, so we don’t actually need a full GV.  (As a bonus, GvIO will
already work on a non-GV and return NULL, so that part of the code
remains unchanged.)

7 years agobuffer overflow in "string terminator" err msg
David Mitchell [Tue, 16 Aug 2016 12:50:46 +0000 (13:50 +0100)]
buffer overflow in "string terminator" err msg

RT #128952

In
    eval "q" . chr(100000000064);

generating the error message C<Can't find string terminator "XXX"'>
was overrunning a buffer designed to hold a single utf8 char, since
it wasn't allowing for the \0 at the end.

7 years agoperldelta for e94ea821c9
Father Chrysostomos [Tue, 16 Aug 2016 01:09:17 +0000 (18:09 -0700)]
perldelta for e94ea821c9

7 years agoperldelta for #128740 / d35c1b5e4
Father Chrysostomos [Tue, 16 Aug 2016 01:07:43 +0000 (18:07 -0700)]
perldelta for #128740 / d35c1b5e4

7 years agoperldelta for 10030f4b9
Father Chrysostomos [Tue, 16 Aug 2016 01:03:43 +0000 (18:03 -0700)]
perldelta for 10030f4b9

7 years agoperldelta for 7bb33634741
Father Chrysostomos [Tue, 16 Aug 2016 01:00:08 +0000 (18:00 -0700)]
perldelta for 7bb33634741

7 years agoperldelta for b199a3980
Father Chrysostomos [Tue, 16 Aug 2016 00:58:12 +0000 (17:58 -0700)]
perldelta for b199a3980

7 years agoperldelta for #128701 / cb65013574
Father Chrysostomos [Tue, 16 Aug 2016 00:54:29 +0000 (17:54 -0700)]
perldelta for #128701 / cb65013574

7 years agoXS::APItest: Note why we do not want efficiency
Father Chrysostomos [Mon, 15 Aug 2016 04:36:39 +0000 (21:36 -0700)]
XS::APItest: Note why we do not want efficiency

7 years ago"" . open(my $fh,...) gave wrong warning
David Mitchell [Mon, 15 Aug 2016 10:39:11 +0000 (11:39 +0100)]
"" . open(my $fh,...) gave wrong warning

RT #128940

    $ perl -we 'print "" . open my $fh, "<", "no / such / file"'
    Use of uninitialized value $fh in concatenation (.) or string at -e line 1.
                           ^^^

7 years agoperldelta: @a = sort @a fix
David Mitchell [Mon, 15 Aug 2016 08:36:22 +0000 (09:36 +0100)]
perldelta: @a = sort @a fix

7 years agoHash-Util/Util.xs: silence compiler warnings
David Mitchell [Mon, 15 Aug 2016 08:17:52 +0000 (09:17 +0100)]
Hash-Util/Util.xs: silence compiler warnings

    Util.c: In function ‘XS_Hash__Util_bucket_ratio’:
    Util.c:638:7: warning: unused variable ‘RETVAL’ [-Wunused-variable]
      SV * RETVAL;

Don't declare a return type if we're not going to use it.