This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perl5.git
7 years ago[perl #129106] Check for null PL_curcop in IN_LC()
Father Chrysostomos [Wed, 7 Sep 2016 05:11:05 +0000 (22:11 -0700)]
[perl #129106] Check for null PL_curcop in IN_LC()

or, rather, in macros that it calls.

When exiting a string eval, the current cop may be freed, so PL_curcop
gets set to null.  With the -DC option, we may end up printfing NVs
during scope exit, so the locale macros used to make sure that the
locale is sane before converting the numbers to strings need to make
sure not to read PL_curcop->cop_hints when PL_curcop is null.

This used to crash with: ./miniperl -DC -e'eval "l/A"'

I’m not sure how to write a test for this, or even whether it’s worth
writing a test for -D, which often changes behaviour depending on
porters’ whims.

7 years agofix a stupid type error
Tony Cook [Wed, 7 Sep 2016 01:16:49 +0000 (11:16 +1000)]
fix a stupid type error

7 years ago(perl #128988) preserve PL_oldoldbufptr is preserved in scan_heredoc()
Tony Cook [Mon, 22 Aug 2016 03:56:26 +0000 (13:56 +1000)]
(perl #128988) preserve PL_oldoldbufptr is preserved in scan_heredoc()

In some cases this is used in building error messages.

7 years ago(perl #128095) check pack_sockaddr_un()'s return value
Tony Cook [Mon, 15 Aug 2016 00:39:22 +0000 (10:39 +1000)]
(perl #128095) check pack_sockaddr_un()'s return value

pack_sockaddr_un() silently truncates the supplied path if it won't
fit into the sun_path member of sockaddr_un.

This may change in the future, but for now check the path in the
sockaddr matches the desired path, and skip if it doesn't.

7 years agoFix up B::Concise tests following op flag change
Father Chrysostomos [Mon, 5 Sep 2016 17:14:29 +0000 (10:14 -0700)]
Fix up B::Concise tests following op flag change

7 years ago[perl #47047] Fix erroneous AUTOLOAD warning
Father Chrysostomos [Mon, 5 Sep 2016 16:31:31 +0000 (09:31 -0700)]
[perl #47047] Fix erroneous AUTOLOAD warning

If there was a stub present in the package into which the invocant had
been blessed, then AUTOLOADing via a *method* call would warn with ‘Use
of inherited AUTOLOAD for non-method’ even if it is a method.

A recent commit stopped OPf_REF from being set on OP_ENTERSUB, so this
commit uses that flag to indicate a method call, to allow a fast run-
time check to see whether to pass the method flag to gv_autoload.

7 years agoTest for perl #47047
Rick Delaney [Mon, 5 Sep 2016 16:25:59 +0000 (09:25 -0700)]
Test for perl #47047

7 years agoNo need to skip t/op/dump.t on darwin
Father Chrysostomos [Mon, 5 Sep 2016 06:27:42 +0000 (23:27 -0700)]
No need to skip t/op/dump.t on darwin

7 years agoStop setting OPf_REF on OP_ENTERSUB
Father Chrysostomos [Mon, 5 Sep 2016 06:14:21 +0000 (23:14 -0700)]
Stop setting OPf_REF on OP_ENTERSUB

It isn’t doing anything really here, and I need it for
another purpose.

7 years agotoke.c: fix mswin32 builds
David Mitchell [Mon, 5 Sep 2016 14:49:28 +0000 (15:49 +0100)]
toke.c: fix mswin32 builds

9bde56224 added this as part of macro:

- PL_last_lop_op = f; \
+ PL_last_lop_op = f < 0 ? -f : f; \

which broke win32 builds due to this

    UNIBRACK(-OP_ENTEREVAL)

expanding to

    PL_last_lop_op = -345 < 0 ? --345 : -345

and the -- being seen as a pre-dec op.

Diagnosed by Dagfinn Ilmari Mannsåker.

7 years agoMake the "where install" directories Unix-format on VMS.
Craig A. Berry [Mon, 5 Sep 2016 02:13:28 +0000 (21:13 -0500)]
Make the "where install" directories Unix-format on VMS.

These paths will get converted to Unix format for loading into
@INC anyway, but since 483efd0abe3 they really need to start out
that way.  Otherwise, when running under a Unix shell, the path
delimiter will be ':' and the absolute VMS specs will get split
in half in S_incpush_use_sep(), which kicks in before the
conversion to Unix format.

7 years agoTainted dirs on VMS when not under DCL.
Craig A. Berry [Mon, 5 Sep 2016 02:10:06 +0000 (21:10 -0500)]
Tainted dirs on VMS when not under DCL.

Since 483efd0abe3 the path delimiter is a ':' instead of '|' on
VMS when running under a Unix shell.  So use that as a guide
to whether we should use a colon or a slash to detect relative
directories that should be tainted.

7 years agonewATTRSUB_x(): document what the cv var is for
David Mitchell [Mon, 5 Sep 2016 11:50:37 +0000 (12:50 +0100)]
newATTRSUB_x(): document what the cv var is for

7 years agomake S_already_defined() in op.c return void
David Mitchell [Mon, 5 Sep 2016 11:46:02 +0000 (12:46 +0100)]
make S_already_defined() in op.c return void

Currently it returns a boolean value, but after the removal of the MAD
code, this value is just equivalent to its 'block' arg; so instead just
make its callers test 'block' instead. This makes the calling code in
newATTRSUB_x and newMYSUB easier to follow.

Also, put the block condition on a single line (whitespace change)

7 years agoreindent and reformat newMYSUB and newATTRSUB_x
David Mitchell [Mon, 5 Sep 2016 11:37:55 +0000 (12:37 +0100)]
reindent and reformat newMYSUB and newATTRSUB_x

This commit only contains whitespace changes.

As a follow-on from the previous commit, reindent a  couple of block of
code; but also do a general re-indenting and partial refomatting of these
two similar functions, which were a bit of mess and hard to follow:

    * replace weird mixtures of indents with standard 4-indents;
    * split if (X) Y  into two lines;
    * separate out blocks with a blank line;
    * outdent labels by exactly 2 spaces

7 years agonewMYSUB/Perl_newATTRSUB_x remove a goto
David Mitchell [Mon, 5 Sep 2016 11:08:56 +0000 (12:08 +0100)]
newMYSUB/Perl_newATTRSUB_x remove a goto

In both these functions there is code like:

    if (!block)
       goto attrs;
    ...
  attrs:

Change them to

    if (block) {
        ...
    }
  attrs:

Lets not use gotos if there's a better way.

Will re-indent in next commit.

7 years agoavoid using freed ops on BEGIN :attr {}
David Mitchell [Mon, 5 Sep 2016 10:52:23 +0000 (11:52 +0100)]
avoid using freed ops on BEGIN :attr {}

If a BEGIN sub has a code attribute applied (no idea why you would want to
do such a thing, but it's not illegal) then part of applying the attribute
is to do 'use attributes', which compiles

    BEGIN { require "attributes"; attributes->import(AAA) }

so we end up compiling a BEGIN while in the middle of compiling a BEGIN.
The part of Perl_newATTRSUB_x() that under some circumstances copies
the body of the newly-compiled CV to the old CV which occupies the name
slot, kicks in here.

Since the ops that make up the AAA above were allocated from the old
BEGIN's op slabs, they get prematurely freed when the old BEGIN's
ops are discarded by the SvREFCNT_dec(PL_compcv).

The simplest fix is to just avoid the copy if we're compiling a BEGIN.

7 years agodo_sv_dump(): handle CvSTART() as slab address
David Mitchell [Mon, 5 Sep 2016 10:15:49 +0000 (11:15 +0100)]
do_sv_dump(): handle CvSTART() as slab address

If a CV is CvSLABBED(), then CvSTART() points to the op slab rather than a
start op. Make Perl_do_sv_dump() display this more informatively.

7 years agoassert op not freed in finalize_op() and rpeep()
David Mitchell [Sat, 27 Aug 2016 13:28:24 +0000 (14:28 +0100)]
assert op not freed in finalize_op() and rpeep()

This should never happen.

7 years agoparser.t: Suppress warning
Father Chrysostomos [Mon, 5 Sep 2016 05:11:00 +0000 (22:11 -0700)]
parser.t: Suppress warning

7 years agoRegression test for RT #129196
Dan Collins [Sun, 4 Sep 2016 18:43:41 +0000 (14:43 -0400)]
Regression test for RT #129196

7 years ago[perl #129196] Crash/bad read with ‘evalbytes S’
Father Chrysostomos [Mon, 5 Sep 2016 03:24:19 +0000 (20:24 -0700)]
[perl #129196] Crash/bad read with ‘evalbytes S’

5dc13276 added some code to toke.c that did not take into account
that the opnum (‘f’) argument to UNI* could be a negated op number.
PL_last_lop_op must never be negative, since it is used as an offset
into a struct.

Tests for the crash will come in the next commit.

7 years agoinline.h: Declare functions to be inline
Karl Williamson [Sat, 3 Sep 2016 18:17:17 +0000 (12:17 -0600)]
inline.h: Declare functions to be inline

The branch merged with commit 8d19ebbca9eecf219cc453cffe88722722860dd9
forgot to give this hint to the compiler.

7 years agorelease_schedule.pod: Tick off last month
Father Chrysostomos [Sun, 4 Sep 2016 23:02:02 +0000 (16:02 -0700)]
release_schedule.pod: Tick off last month

7 years ago[perl #129073] Assert failure: ${p{};sub p}()
Father Chrysostomos [Sun, 4 Sep 2016 21:22:37 +0000 (14:22 -0700)]
[perl #129073] Assert failure: ${p{};sub p}()

When parsing the special ${var{subscript}} syntax, the lexer notes
that the } matching the ${ will be a fake bracket, and should
be ignored.

In the case of ${p{};sub p}() the first syntax error causes tokens to
be popped, such that the } following the sub declaration ends up being
the one treated as a fake bracket and ignored.

The part of the lexer that deals with sub declarations treats a ( fol-
lowing the sub name as a prototype (which is a single term) if signa-
tures are disabled, but ignores it and allows the rest of the lexer to
treat it as a parenthesis if signatures are enabled.

Hence, the part of the parser (perly.y) that parses signatures knows
that a parenthesis token can only come after a sub if signatures are
enabled, and asserts as much.

In the case of an error and tokens being discarded, a parenthesis may
come after a sub name as far as the parser is concerned, even though
there was a } in between that got discarded.  The sub part of the
lexer, of course did not see the parenthesis because of the interven-
ing brace, and did not treat it as a prototype.  So we get an asser-
tion failure.

The simplest fix is to loosen up the assertion and allow for anomalies
after errors.  It does not hurt to go ahead and parse a signature at
this point, even though the feature is disabled, because there has
been a syntax error already, so the parsed code will never run, and
the parsed sub will not be installed.

7 years agoFix checks for tainted dir in $ENV{PATH}
Father Chrysostomos [Sat, 3 Sep 2016 20:30:22 +0000 (13:30 -0700)]
Fix checks for tainted dir in $ENV{PATH}

$ cat > foo
#!/usr/bin/perl
print "What?!\n"
^D
$ chmod +x foo
$ ./perl -Ilib -Te '$ENV{PATH}="."; exec "foo"'
Insecure directory in $ENV{PATH} while running with -T switch at -e line 1.

That is what I expect to see.  But:

$ ./perl -Ilib -Te '$ENV{PATH}="/\\:."; exec "foo"'
What?!

Perl is allowing the \ to escape the :, but the \ is not treated as an
escape by the system, allowing a relative path in PATH to be consid-
ered safe.

7 years agotaint.t: Set up @INC before using it
Father Chrysostomos [Sat, 3 Sep 2016 17:15:22 +0000 (10:15 -0700)]
taint.t: Set up @INC before using it

The ‘chdir t’ line is useless if we require ./loc_tools.pl before
setting up @INC properly, as loc_tools.pl uses warnings.pm.

7 years agoTry harder to clean up %ENV in 140_proxy.t.
Craig A. Berry [Sat, 3 Sep 2016 15:59:55 +0000 (10:59 -0500)]
Try harder to clean up %ENV in 140_proxy.t.

While the localization earlier in the test *should* leave the
relevent %ENV entries in a good state for the final test, for
some reason this is not happening on VMS.  It may have something
to do with the fact that %ENV has all upper case keys but the
test has previously localized both upper and lower case versions.

In any case, even though it isn't this test's fault, the easiest
and safest way to get it passing is to just do another clean-up.

Awaiting upstream application at:

https://github.com/chansen/p5-http-tiny/pull/95

7 years agoDon't pollute $ENV{LC_ALL} in pod/perlmodlib.PL.
Craig A. Berry [Fri, 2 Sep 2016 20:43:52 +0000 (15:43 -0500)]
Don't pollute $ENV{LC_ALL} in pod/perlmodlib.PL.

Because on VMS, DYNAMIC_ENV_FETCH makes environment settings
persist after program exit, and running a program (e.g. Perl)
does not normally start a separate process.  This was confusing
the inadequate attempt in t/run/locale.t to clear the locale-related
environment variables.

7 years agoDelete localized %ENV entries in t/run/locale.t.
Craig A. Berry [Fri, 2 Sep 2016 19:59:25 +0000 (14:59 -0500)]
Delete localized %ENV entries in t/run/locale.t.

Localizing %ENV entries actually instantiates them with an undef
value, which, at least on VMS, gets propagated to the various
runperl subprocesses where it can trigger locale warnings at start-up
time.  Deleting the localized entries, though, actually removes
them from the localized %ENV:

$ perl -E '{ local $ENV{FOO}; say exists $ENV{FOO} ? 'Y' : 'N'; }'
Y
$ perl -E '{ delete local $ENV{FOO}; say exists $ENV{FOO} ? 'Y' : 'N'; }'
N

but any pre-existing values in outer scope are safely restored when
the local scope exits.

This gets this test passing on VMS again for the first time in a
very long time.  It turns out pod/perlmodlib.PL has been polluting
LC_ALL and this test has not been adequately defending itself.

7 years agoMore stderr suppression in t/run/locale.t.
Craig A. Berry [Fri, 2 Sep 2016 19:17:45 +0000 (14:17 -0500)]
More stderr suppression in t/run/locale.t.

Closing stderr in the parent process doesn't have any effect on
Perl in the subprocess on VMS, so use the facility in the test
infrastructure to suppress stderr there as well.

7 years agoRemove obsolete Test prereq from PathTools
Dagfinn Ilmari Mannsåker [Fri, 2 Sep 2016 15:47:45 +0000 (16:47 +0100)]
Remove obsolete Test prereq from PathTools

It was ported to Test::More in cba09117 in 2011, but the upstream
Makefile.PL that was added in 8e6d3e2b in 2013 took the Makefile.PL from
the last CPAN release which was from 2008.

7 years agoMake PERLLIB_SEP dynamic on VMS.
Craig A. Berry [Thu, 1 Sep 2016 18:30:28 +0000 (13:30 -0500)]
Make PERLLIB_SEP dynamic on VMS.

Because if we're running under a Unix shell, the path separator is
likely to meet the expectations of Unix shell scripts better if it's
the Unix ':' rather than the VMS '|'.  There is no change when
running under DCL.

7 years agoCorrect 'map' documentation to reflect operation on a list.
Dave Cross [Thu, 1 Sep 2016 22:29:58 +0000 (18:29 -0400)]
Correct 'map' documentation to reflect operation on a list.

Rather than on an array.

For: RT #126169.

Dave Cross is now a Perl Author.

7 years agoProvide missing link for one instance of 'eval'.
James E Keenan [Thu, 1 Sep 2016 18:39:16 +0000 (14:39 -0400)]
Provide missing link for one instance of 'eval'.

As originally reported by KES.  See RT #129168.

7 years agoFix is_utf8_valid_partial_char()
Karl Williamson [Thu, 1 Sep 2016 18:07:33 +0000 (12:07 -0600)]
Fix is_utf8_valid_partial_char()

This should have been part of 4dab108fb5e7e21a547733bb00ddb5d8bffd936d,
but when I was rebasing, these changes got moved to an unrelated commit
that hasn't been pushed yet, and I didn't notice immediately.  I will
add som API tests for this in the next few days.

7 years agoAdd C macros for UTF-8 for BOM and REPLACEMENT CHARACTER
Karl Williamson [Sun, 28 Aug 2016 03:17:49 +0000 (21:17 -0600)]
Add C macros for UTF-8 for BOM and REPLACEMENT CHARACTER

This makes it easy for module authors to write XS code that can use
these characters, and be automatically portable to EBCDIC systems.

7 years agoMerge branch for improving API UTF-8 handling into blead
Karl Williamson [Thu, 1 Sep 2016 02:33:21 +0000 (20:33 -0600)]
Merge branch for improving API UTF-8 handling into blead

This set of commits came about to allow XS code to more easily and
quickly check for valid UTF-8 without rolling their own, which could be
lacking in security considerations.

Most of the small UTF-8 handling functions have now been inlined, and
the validity-only checking function has been rewritten to never need to
actually calculate the code point the UTF-8 represents.

The original impetus for this was because of changes in Encode that made
it vulnerable to malformed UTF-8.  These changes were to speed up its
UTF-8 processing.  By changing Encode to use this new stuff, it is
sped up on valid input by over a factor of 5 from the original
implementation, at the expense of slowing down entirely invalid input by
a factor of 4.  Since we are expecting mostly valid input, this is an
overall big win.  The original handrolled Encode changes sped up valid
input handling by about 1.5, without slowing handling of invalid down
appreciably.

7 years agoUse new is_utf8_valid_partial_char()
Karl Williamson [Mon, 29 Aug 2016 04:04:16 +0000 (22:04 -0600)]
Use new is_utf8_valid_partial_char()

This new function can be used in the implementation of the file test
operators, -B and -T, to see if the whole fixed length buffer is valid
UTF-8.  Previously if all bytes were UTF-8 except the bytes at the end
that could have been a partial character, it assumed the whole thing was
UTF-8.  This improves the prediction slightly

7 years agoAdd is_utf8_valid_partial_char()
Karl Williamson [Sun, 28 Aug 2016 16:54:13 +0000 (10:54 -0600)]
Add is_utf8_valid_partial_char()

This new function can test some purported UTF-8 to see if it is
well-formed as far as it goes.  That is there aren't enough bytes for
the character they start, but what is there is legal so far.  This can
be useful in a fixed width buffer, where the final character is split in
the middle, and we want to test without waiting for the next read that
the entire buffer is valid.

7 years agoMake 3 UTF-8 macros API
Karl Williamson [Sun, 28 Aug 2016 02:08:52 +0000 (20:08 -0600)]
Make 3 UTF-8 macros API

These may be useful to various module writers.  They certainly are
useful for Encode.  This makes public API macros to determine if the
input UTF-8 represents (one macro for each category)
    a) a surrogate code point
    b) a non-character code point
    c) a code point that is above Unicode's legal maximum.

The macros are machine generated.  In making them public, I am now using
the string end location parameter to guard against running off the end
of the input.  Previously this parameter was ignored, as their use in
the core could be tightly controlled so that we already knew that the
string was long enough when calling these macros.  But this can't be
guaranteed in the public API.  An optimizing compiler should be able to
remove redundant length checks.

7 years agoutf8.c: Add comments
Karl Williamson [Fri, 26 Aug 2016 22:47:32 +0000 (16:47 -0600)]
utf8.c: Add comments

7 years agois_utf8_string() is now a pure function
Karl Williamson [Fri, 26 Aug 2016 22:53:00 +0000 (16:53 -0600)]
is_utf8_string() is now a pure function

as of the previous commit

7 years agoMove isUTF8_CHAR helper function, and reimplement it
Karl Williamson [Fri, 26 Aug 2016 22:29:54 +0000 (16:29 -0600)]
Move isUTF8_CHAR helper function, and reimplement it

The macro isUTF8_CHAR calls a helper function for code points higher
than it can handle.  That function had been an inlined wrapper around
utf8n_to_uvchr().

The function has been rewritten to not call utf8n_to_uvchr(), so it is
now too big to be effectively inlined.  Instead, it implements a faster
method of checking the validity of the UTF-8 without having to decode
it.  It just checks for valid syntax and now knows where the
few discontinuities are in UTF-8 where overlongs can occur, and uses a
string compare to verify that overflow won't occur.

As a result this is now a pure function.

This also causes a previously generated deprecation warning to not be,
because in printing UTF-8, no longer does it have to be converted to
internal form.  I could add a check for that, but I think it's best not
to.  If you manipulated what is getting printed in any way, the
deprecation message will already have been raised.

This commit also fleshes out the documentation of isUTF8_CHAR.

7 years agoAdd #defines for UTF-8 of highest representable code point
Karl Williamson [Fri, 26 Aug 2016 22:23:24 +0000 (16:23 -0600)]
Add #defines for UTF-8 of highest representable code point

This will allow the next commit to not have to actually try to decode
the UTF-8 string in order to see if it overflows the platform.

7 years agoutf8.h: Add some LIKELY() to help branch prediction
Karl Williamson [Fri, 26 Aug 2016 22:21:25 +0000 (16:21 -0600)]
utf8.h: Add some LIKELY() to help branch prediction

This macro gives the legal UTF-8 byte sequences.  Almost always, the
input will be legal, so help compiler branch prediction for that.

7 years agoutf8.h, utfebcdic.h: Add comments, align white space
Karl Williamson [Fri, 26 Aug 2016 22:07:22 +0000 (16:07 -0600)]
utf8.h, utfebcdic.h: Add comments, align white space

7 years agoInline is_utf8_string() and is_utf8_stringloclen()
Karl Williamson [Fri, 26 Aug 2016 21:53:36 +0000 (15:53 -0600)]
Inline is_utf8_string() and is_utf8_stringloclen()

7 years agoInline utf8_distance(), utf8_hop()
Karl Williamson [Fri, 26 Aug 2016 21:03:52 +0000 (15:03 -0600)]
Inline utf8_distance(), utf8_hop()

7 years agoSlightly simplify utf8_to_uvuni_buf()
Karl Williamson [Fri, 26 Aug 2016 20:47:17 +0000 (14:47 -0600)]
Slightly simplify utf8_to_uvuni_buf()

Use a function that does the same thing.  This also clarifies a related
comment

7 years agoInline is_utf8_invariant_string()
Karl Williamson [Fri, 26 Aug 2016 20:07:50 +0000 (14:07 -0600)]
Inline is_utf8_invariant_string()

7 years agois_utf8_invariant_string is pure
Karl Williamson [Fri, 26 Aug 2016 19:54:51 +0000 (13:54 -0600)]
is_utf8_invariant_string is pure

As are its synonyms.  This also declares the formal parameters 'const'

7 years agoSimplify slightly is_utf8_invariant_string
Karl Williamson [Fri, 26 Aug 2016 19:52:52 +0000 (13:52 -0600)]
Simplify slightly is_utf8_invariant_string

This eliminates an unnecessary branch test in unoptimized code.

7 years agoUse new name 'is_utf8_invariant_string' in core
Karl Williamson [Fri, 26 Aug 2016 19:42:53 +0000 (13:42 -0600)]
Use new name 'is_utf8_invariant_string' in core

This changes the places in the core to use the clearer synonym added by
the previous commit.  It also changes one place that hand-rolled its own
code to use this function instead.

7 years agoAdd new synonym 'is_utf8_invariant_string'
Karl Williamson [Fri, 26 Aug 2016 19:35:28 +0000 (13:35 -0600)]
Add new synonym 'is_utf8_invariant_string'

This is clearer as to its meaning than the existing 'is_ascii_string'
and 'is_invariant_string', which are retained for back compat.  The
thread context variable is removed as it is not used.

7 years agoembed.fnc: Replace blanks by tabs
Karl Williamson [Tue, 23 Aug 2016 19:37:10 +0000 (13:37 -0600)]
embed.fnc: Replace blanks by tabs

In this file, tabs are the more accepted field delimiter, and having
them makes it easier to search for particular patterns in it.

7 years agoutf8.c: Use 'break' instead of 'goto'
Karl Williamson [Mon, 22 Aug 2016 18:28:21 +0000 (12:28 -0600)]
utf8.c: Use 'break' instead of 'goto'

The goto is a relic of a previous implementation; 'break' is preferred
if there isn't a reason to use goto.

7 years agois_utf8_string_loc() param should not be NULL
Karl Williamson [Mon, 22 Aug 2016 18:25:00 +0000 (12:25 -0600)]
is_utf8_string_loc() param should not be NULL

It makes no sense to call this function with a NULL parameter, as the
whole point of using this function is to set what that param points to.
If you don't want this, you should be using the similar function that
doesn't have this parameter.

7 years agoDocument valid_utf8_to_uvchr() and inline it
Karl Williamson [Mon, 22 Aug 2016 18:21:06 +0000 (12:21 -0600)]
Document valid_utf8_to_uvchr() and inline it

This function has been in several releases without problem, and is short
enough that some compilers can inline it.  This commit also notes that
the result should not be ignored, and removes the unused pTHX.  The
function has explicitly been marked as being changeable, and has not
been part of the API until now.

7 years agoutf8.c: Clarify comments for valid_utf8_to_uvchr()
Karl Williamson [Mon, 22 Aug 2016 16:48:55 +0000 (10:48 -0600)]
utf8.c: Clarify comments for valid_utf8_to_uvchr()

7 years agoutf8.c: Join EBCDIC/non-EBCDIC code
Karl Williamson [Mon, 22 Aug 2016 16:59:48 +0000 (10:59 -0600)]
utf8.c: Join EBCDIC/non-EBCDIC code

This was missed in 534752c1d25d7c52c702337927c37e40c4df103d

7 years agoregen/embed.pl: Allow inline funcs to be named Perl_foo
Karl Williamson [Fri, 26 Aug 2016 21:25:20 +0000 (15:25 -0600)]
regen/embed.pl: Allow inline funcs to be named Perl_foo

When inlining an existing public function whose name begins with Perl_,
it's best to keep that name, in case someone is calling it that way.
Prior to this commit, the name had to be changed to S_foo.

7 years agoUpdate outdated man links for strlcpy and strlcat.
Theo Buehler [Sat, 27 Aug 2016 01:36:28 +0000 (03:36 +0200)]
Update outdated man links for strlcpy and strlcat.

7 years agoAdd Theo Buehler to AUTHORS
Karl Williamson [Thu, 1 Sep 2016 00:07:55 +0000 (18:07 -0600)]
Add Theo Buehler to AUTHORS

7 years agoPATCH: [perl #129122] regex sets syntax error
Karl Williamson [Wed, 31 Aug 2016 23:05:45 +0000 (17:05 -0600)]
PATCH: [perl #129122] regex sets syntax error

This was caused by two statements being in the wrong order.  One should
save something on the stack before changing it, not after.

However fixing this led to the discovery of another bug in which an
error case was failed to be detected.

7 years agoregcomp.c: Typo, spacing in comment
Karl Williamson [Wed, 31 Aug 2016 22:57:20 +0000 (16:57 -0600)]
regcomp.c: Typo, spacing in comment

7 years agoPorting/bisect.pl: /usr/sbin/sysctl exists
Karl Williamson [Sun, 24 Jul 2016 00:28:52 +0000 (18:28 -0600)]
Porting/bisect.pl: /usr/sbin/sysctl exists

7 years agoRevert "perlinterp: Use 'e.g' not 'i.e.' for 'for example'"
Karl Williamson [Mon, 29 Aug 2016 23:06:50 +0000 (17:06 -0600)]
Revert "perlinterp: Use 'e.g' not 'i.e.' for 'for example'"

This reverts commit ce66b506fa280c2ede0b0d4a3e81b53d0e31cb48.

I misread the text.  This is an exhaustive list, so "i.e." is proper.

7 years agoPATCH: [perl #129038] Crash with s///l
Karl Williamson [Sun, 28 Aug 2016 01:16:17 +0000 (19:16 -0600)]
PATCH: [perl #129038] Crash with s///l

The cause of this was bad logic.  It thought it was dealing with UTF-8
when it wasn't.

7 years agoperlinterp: Use 'e.g' not 'i.e.' for 'for example'
Karl Williamson [Sun, 28 Aug 2016 15:39:38 +0000 (09:39 -0600)]
perlinterp: Use 'e.g' not 'i.e.' for 'for example'

7 years ago[RT #129069] Perl_yylex: Fix two use-after-free bugs
Dan Collins [Wed, 24 Aug 2016 18:19:09 +0000 (14:19 -0400)]
[RT #129069] Perl_yylex: Fix two use-after-free bugs

Perl_yylex maintains up to two pointers, `s` and `d`, into the parser
buffer at PL_bufptr. It can call skipspace(), which can potentially
grow (and realloc) its argument. This can leave the second pointer
pointing at the old buffer. Under most cases it isn't visible, because
the old buffer isn't reused or zeroed. However, under Valgrind or
libdislocator, this memory management error becomes visible.

This patch saves the location of the second pointer in two locations,
and restores it after the call to skipspace.

7 years ago[perl #125679] Don’t make lvref ops on error
Father Chrysostomos [Sun, 28 Aug 2016 14:21:19 +0000 (07:21 -0700)]
[perl #125679] Don’t make lvref ops on error

When converting an op into an lvref op (the rv2av in \(@_)=... gets
converted while the refgen gets nulled), if we reject the op as a
valid one for refaliasing we should not go ahead and convert it.  It
we do convert it (as we were doing), then we may convert an op that
uses op_targ for auxiliary information into one that uses it as a pad
offset.  When freeing the op, we will then be reading a ‘random’ off-
set in the pad and trying to free the SV.  That pad entry may not even
be within the pad.

In the specific case of entereval, op_targ holds the hints, and the
larger the value of $^H, the more likely it is to crash.  So
BEGIN{$^H=-1}\eval=... will crash.

7 years agoUpgrade to Thread::Semaphore 2.13
jdhedden [Sat, 27 Aug 2016 13:01:40 +0000 (09:01 -0400)]
Upgrade to Thread::Semaphore 2.13

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