This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perl5.git
10 years agomake_ext.pl should validate exactly which clean targets it can be used for.
Nicholas Clark [Thu, 27 Feb 2014 09:20:38 +0000 (10:20 +0100)]
make_ext.pl should validate exactly which clean targets it can be used for.

Previously it would accept anything matching /clean$/. Now we check for the 4
names that we know the top level Makefile defines.

10 years agoregen/regcharclass.pl: Forbid non-safe macros for multi-char matches
Karl Williamson [Sun, 2 Mar 2014 02:35:00 +0000 (19:35 -0700)]
regen/regcharclass.pl: Forbid non-safe macros for multi-char matches

For matches that can match more than a single code point, one should
always use a macro that makes sure that one doesn't read off the end of
the buffer.  This is because the buffer might end with the first N
characters of a sequence with at least N+1 in it, and we don't want to
read that N+1 position in the buffer.

If this had been in place, buggy commit 3a8bbffbce would not have
happened.

10 years agoregen/regcharclass.pl: Don't generate unused macros
Karl Williamson [Sun, 2 Mar 2014 02:27:43 +0000 (19:27 -0700)]
regen/regcharclass.pl: Don't generate unused macros

The macros generated by these options are not needed in the core;
generating them just clutters up the header file, and some will actually
be forbidden by the next commit.

10 years agoRevert most of 3a8bbffbce: Avoid unnecessary malformed checking
Karl Williamson [Sun, 2 Mar 2014 01:47:10 +0000 (18:47 -0700)]
Revert most of 3a8bbffbce: Avoid unnecessary malformed checking

My thinking was muddled when I made that commit, and this reverts the
essence of it.  The theory was that since we have already processed the
regex pattern, we don't need to check it for malformedness, hence we
don't need the "safe" form of certain macros that check for and avoid
running off the end of the buffer.  It is true that we don't have to
worry about malformedness indicating that the buffer is bigger than it
really is, but these macros can match up to three well-formed
characters, so we do have to make sure that all three are in the buffer,
and that the input isn't just the first two at the buffer's end.

This was caught by running valgrind.

10 years agoperluniprops: Show property name without braces
Karl Williamson [Sun, 2 Mar 2014 01:28:30 +0000 (18:28 -0700)]
perluniprops: Show property name without braces

Properties wth single letter names may be expressed with and without the
brakces; \p{L} and \pL are synonymous.  This commit makes both forms
be in perluniprops, so someone who doesn't know the detailed rules can
search for either to see what it is.

This was suggested by Zsbán Ambrus.

10 years agoregen/regcharclass.pl: White-space; comment nits only
Karl Williamson [Fri, 28 Feb 2014 18:46:10 +0000 (11:46 -0700)]
regen/regcharclass.pl: White-space; comment nits only

Indent to account for new block added in the previous commit

10 years agoregen/regcharclass.pl: Simplify generated safe macros
Karl Williamson [Fri, 28 Feb 2014 18:24:01 +0000 (11:24 -0700)]
regen/regcharclass.pl: Simplify generated safe macros

This simplifies the macros generated which make sure there are no read
errors.  Prior to this commit, the code generated looked like

      (e - s) > 3
      ? see if things of at most length 4 match
      : (e - s) > 2
        ? see if things of at most length 3 match
        : (e - s) > 1
          ? see if things of at most length 2 match
          : (e - s) > 0
            ? see if things of at most length 1 match

For things that are a single character, the ones greater than length 2
must be in UTF8, and their needed length can be determined by UTF8SKIP,
so we can get rid of most of the (e-s) tests.

This doesn't change the macros which can match multiple characters; that
is a harder to do.

10 years agoUnicode/UCD.t: Fix broken test
Karl Williamson [Fri, 28 Feb 2014 17:27:49 +0000 (10:27 -0700)]
Unicode/UCD.t: Fix broken test

The test file special cases certain properties by name.  However, it
turns out that a Unihan property that isn't normally compiled by Perl
also should be included.  And all these properties share the same format
given in their files.  So, instead of using the property names, use that
format; this leads to code which is general, and simpler at the same time.

10 years agomktables: Allow Unicode Unihan files to compile
Karl Williamson [Fri, 28 Feb 2014 16:58:33 +0000 (09:58 -0700)]
mktables: Allow Unicode Unihan files to compile

Perl normally doesn't include the Unicode Unihan files, but someone is
free to recompile Perl with these.  However, starting with commit
9e65c3f47e483ee7e33b5d748a06f4addd830d60, mktables checks for the
version number on the input files and refuses to compile if incorrect.
(This is to catch Perl trying to compile from a DB with inconsistent
files; I believe Perl used to be shipped with these synchronization
errors.)  However, the Unihan files in Unicode 6.3 do not have the same
syntax as the rest of the files, so since that commit Perl refuses to
compile Unihan.

The files are being updated in 7.0 to use the same syntax as the rest,
so rather than hard-code the current syntax as an exception into
mktables, this just skips checking these files until 7.0.

10 years agoregen/regcharclass.pl: Warn that macros are internal only
Karl Williamson [Thu, 27 Feb 2014 17:25:24 +0000 (10:25 -0700)]
regen/regcharclass.pl: Warn that macros are internal only

This adds a comment to the generated file that the macros are not to be
generally used.

10 years agoNo need for code conditional on S_IFMT being defined, as perl.h has a fallback.
Nicholas Clark [Sat, 1 Mar 2014 16:58:05 +0000 (17:58 +0100)]
No need for code conditional on S_IFMT being defined, as perl.h has a fallback.

Commit c623bd54707a8bf9 (Jan 1991) added code conditionally compiled if
S_IFMT was defined. However, the checks were immediately redundant, because
the same commit also added code to perl.h to define a fallback value for
S_IFMT if the OS headers did not define it, which is unchanged to this day.
Hence the code added in an #else as part of commit 99b89507a1fb507c (Nov
1991) has never ever been needed.

10 years agopp_tms should use a local struct tms, instead of PL_timesbuf.
Nicholas Clark [Sat, 1 Mar 2014 16:40:05 +0000 (17:40 +0100)]
pp_tms should use a local struct tms, instead of PL_timesbuf.

PL_timesbuf is effectively a vestige of Perl 1, and doesn't actually need to
be an interpreter variable. It will be removed early in v5.21.x, but it's a
good idea to refactor the code not to use it before then. A local struct tms
will be on the C stack, which will be in the CPU's L1 cache, whereas the
relevant part of the interpreter struct may well not be in the CPU cache at
all. Therefore this change might reduce cache pressure fractionally. A local
variable access should also be simpler machine code on most CPU architectures.

10 years agoCommit 5c85b638cb45ea2b inadvertently broke the -DDEBUGGING build.
Nicholas Clark [Sat, 1 Mar 2014 12:35:16 +0000 (13:35 +0100)]
Commit 5c85b638cb45ea2b inadvertently broke the -DDEBUGGING build.

The macros assert_not_ROK(sv) and assert_not_glob(sv) are intended to be used
in expressions, and finish with a trailing comma, so they shouldn't have a ;
after them.

10 years ago[MERGE] tweak in-place branch of SAVEt_CLEARSV
David Mitchell [Fri, 28 Feb 2014 19:46:15 +0000 (19:46 +0000)]
[MERGE] tweak in-place branch of SAVEt_CLEARSV

clean up the code that clears lexical vars on scope exit; chiefly, wrap
all the individual 'unusual case' flag tests in a single big test of the
union of all such flags, so that simple lexical vars skip all the tests.

10 years agoSAVEt_CLEARSV: only clear-in-place if RC==1
David Mitchell [Fri, 28 Feb 2014 19:25:51 +0000 (19:25 +0000)]
SAVEt_CLEARSV: only clear-in-place if RC==1

Currently it takes the 'clear-in-place' branch on lexical vars if
the ref count is <= 1. However, RC < 1 is a "should never happen"
condition, so rather than keeping that damaged var, take the other branch,
which will call SvREFCNT_dec() on it, which will Do the Right Thing
(like emitting a warning).

10 years agoSAVEt_CLEARSV: handle SvOOK() specially
David Mitchell [Fri, 28 Feb 2014 18:40:10 +0000 (18:40 +0000)]
SAVEt_CLEARSV: handle SvOOK() specially

Add SVf_OOK to the list of flags that are handled in the 'slow' branch.
This allows us to avoid checking for hv_kill_backrefs() or sv_backoff()
for the majority of lexicals which won't require it.

10 years agoSAVEt_CLEARSV: expand SvOK_off() macro
David Mitchell [Fri, 28 Feb 2014 18:35:02 +0000 (18:35 +0000)]
SAVEt_CLEARSV: expand SvOK_off() macro

the next commit will change thinks that affect only part of the macro

10 years agoSAVEt_CLEARSV: simplify SvREADONLY_off() condition
David Mitchell [Fri, 28 Feb 2014 17:51:47 +0000 (17:51 +0000)]
SAVEt_CLEARSV: simplify SvREADONLY_off() condition

SAVEt_CLEARSV should always be called with SvPADMY() true, so don't test
for it, but assert it instead. Then change this:

    if (SvPADMY(sv) && !SvFAKE(sv))
         SvREADONLY_off(sv);

The SvPADMY() isn't needed, but we should test for RO-ness instead, to
avoid an unnecessary SvREADONLY_off().

10 years agoSAVEt_CLEARSV: reindent after previous commit
David Mitchell [Fri, 28 Feb 2014 17:45:37 +0000 (17:45 +0000)]
SAVEt_CLEARSV: reindent after previous commit

whitespace-only changes

10 years agoSAVEt_CLEARSV: check common flags
David Mitchell [Fri, 28 Feb 2014 17:32:57 +0000 (17:32 +0000)]
SAVEt_CLEARSV: check common flags

In the 'clear' branch of SAVEt_CLEARSV, there are several individual
if (SvSOMEFLAG(sv)) {...} tests. Wrap all these tests in a single
if (SvFLAGS(sv) & (union|of|all|flags)), so that for the common case
of boring lexicals that don't need special clear up, we can skip all the
individual tests

10 years agoS_regmatch(): merge BOL and SBOL branches
David Mitchell [Fri, 28 Feb 2014 14:48:16 +0000 (14:48 +0000)]
S_regmatch(): merge BOL and SBOL branches

The code body is the same for both of them.

10 years agocopy xhv_rand and xhv_last_rand in threads clone
David Mitchell [Fri, 28 Feb 2014 14:37:13 +0000 (14:37 +0000)]
copy xhv_rand and xhv_last_rand in threads clone

valgrind complains about these fields being uninitialised when cloned into a
new thread, because they aren't copied. It's fairly harmless, since these
fields are just used to perturb hash key iteration; but for completeness,
clone these fields too.

10 years ago[perl #121230] fix kill -SIG on win32
David Mitchell [Sun, 23 Feb 2014 13:25:05 +0000 (13:25 +0000)]
[perl #121230] fix kill -SIG on win32

v5.17.1-137-gc2fd40c tidied up perl's kill() implementation, making
-SIGNAME be handled correctly, It also eliminated the use of the killpg()
system/library call, which these days is usually just a thin wrapper over
kill(). By doing this, it assumed that the following are functionally
equivalent:

 killpg(pgrp, sig)
 kill(-pgrp, sig).

Unfortunately this broke Window's use of the (perl-level)

    kill negative_value, pid, ...

since under Windows, the killpg()/kill() identity doesn't hold
(win32_kill() uses negative ids for fake-PIds, not process groups).

Fix this by restoring the use of killpg() where available.

10 years agospeed up (non)overloaded derefs
David Mitchell [Sat, 15 Feb 2014 22:47:16 +0000 (22:47 +0000)]
speed up (non)overloaded derefs

Consider a class that has some minimal overloading added - e.g. to give
pretty stringification of objects - but which *doesn't* overload
dereference methods such as '@[]'. '%[]' etc.

In this case, simple dereferencing, such as $obj->[0] or  $obj->{foo}
becomes much slower than if the object was blessed into a non-overloaded
class.

This is because every time a dereferencing is performed in pp_rv2av for
example, the "normal" code path has to go through the full checking of:

  * is the stash into which the referent is blessed overloaded? If so,
  * retrieve the overload magic from the stash;
  * check whether the overload method cache has been invalidated and if so
    rebuild it;
  * check whether we are in the scope of 'no overloading', and if so
    is the current method disabled in this scope?
  * Is there a '@{}' or whatever (or 'nomethod') method in the cache?
    If not, then process the ref as normal.

That's a lot of extra overhead to decide that an overloaded method doesn't
in fact need to be called.

This commit adds a new flag to the newish xhv_aux_flags field,
HvAUXf_NO_DEREF, which signals that the overloading of this stash
contains no deref (nor 'nomethod') overloaded methods. Thus a quick check
for this flag in the common case allows us to short-circuit all the above
checks except the first one.

Before this commit, a simple $obj->[0] was about 40-50% slower if the
class it was blessed into was overloaded (but didn't have deref methods);
after the commit, the slowdown is 0-10%. (These timings are very
approximate, given the vagaries of nano benchmarks.)

10 years agoDocument what the gv_check() function does
David Mitchell [Sat, 15 Feb 2014 16:46:40 +0000 (16:46 +0000)]
Document what the gv_check() function does

10 years agogv_check(): use aux flag rather than IsCOW
David Mitchell [Sat, 15 Feb 2014 16:38:31 +0000 (16:38 +0000)]
gv_check(): use aux flag rather than IsCOW

Currently the SVf_IsCOW flag doesn't have any meaning for HVs,
except that it is used in the specific case of gv_check() to temporarily
mark a stash as being scanned. Since stashes will have the HV_AUX fields,
we can use a flags bit in the new xhv_aux_flags field instead.

This then potentially frees up the SVf_IsCOW for use as a new general flag
bit for *all* HVs (including non-stash ones).

10 years agoadd aux_flags field to HVs with aux struct
David Mitchell [Sat, 15 Feb 2014 16:15:11 +0000 (16:15 +0000)]
add aux_flags field to HVs with aux struct

Add an extra U32 general flags field to the xpvhv_aux struct (which is
used on HVs such as stashes, that need extra fields).

On 64-bit systems, this doesn't consume any extra space since there's
already an odd number of I32/U32 fields. On 32-bit systems it will consume
an  extra 4 bytes. But of course only on those hashes that have the aux
struct.

As well as providing extra flags in the AUX case, it will also allow
us to free up at least one general flag bit for HVs - see next commit.

10 years agomake OP_AELEMFAST work with negative indices
David Mitchell [Sun, 23 Feb 2014 00:53:17 +0000 (00:53 +0000)]
make OP_AELEMFAST work with negative indices

Use aelemfast for literal index array access where the index is in the
range -128..127, rather than 0..255.

You'd expect something like $a[-1] or $a[-2] to be a lot more common than
$a[100] say. In fact a quick CPAN grep shows 66 distributions
matching /\$\w+\[\d{3,}\]/, but "at least" 1000 matching /\$\w+\[\-\d\]/.
And most of the former appear to be table initialisations.

10 years ago[MERGE] optmise pp_entersub code
David Mitchell [Thu, 27 Feb 2014 16:32:34 +0000 (16:32 +0000)]
[MERGE] optmise pp_entersub code

Do various bits of minor fiddling with the code of Perl_pp_entersub
to make the binary smaller and hopefully faster. All the usual stuff:
sprinkling LIKELY(), altering scope of vars etc.

All of this should make no functional difference, expect conceivably the
"SvPADTMP() not on IS_PADGV()" change (which also affects code outside
pp_entersub()).

This series of commits reduces the size of the pp_entersub object on gcc
x86_64 by about 11%, and shows no measurable change in performance (i.e.
noise dominates).

10 years agodon't set SvPADTMP() on PADGV's
David Mitchell [Thu, 27 Feb 2014 15:30:26 +0000 (15:30 +0000)]
don't set SvPADTMP() on PADGV's

Under threaded builds, GVs for OPs are stored in the pad rather than
being directly attached to the op. For some reason, all such GV's were
getting the SvPADTMP flag set. There seems to be be no good reason for
this, and after skipping setting the flag, all tests still pass.

The advantage of not setting this flag is that there are quite a few
hot places in the code that do

    if (SvPADTMP(sv) && !IS_PADGV(sv)) {
        ...

I've replaced them all with

    if (SvPADTMP(sv)) {
        assert(!IS_PADGV(sv));
        ...

Since the IS_PADGV() macro expands to something quite heavyweight, this is
quite a saving: for example this commit reduces the size of pp_entersub by
111 bytes.

10 years agopp_entersub(): simplify XSUB arg cleanup code
David Mitchell [Wed, 26 Feb 2014 22:39:52 +0000 (22:39 +0000)]
pp_entersub(): simplify XSUB arg cleanup code

The code that reduces the returned XS args to 1 arg in scalar context
was a bit messy. This makes it smaller, more comprehensible, with slighylu
smaller object size.

10 years agomove PL_defgv nearer the top of intrvar.h
David Mitchell [Wed, 26 Feb 2014 20:54:05 +0000 (20:54 +0000)]
move PL_defgv nearer the top of intrvar.h

on the grounds that its a reasonably hot variable.

10 years agopp_entersub(): tweak some vars
David Mitchell [Wed, 26 Feb 2014 20:47:32 +0000 (20:47 +0000)]
pp_entersub(): tweak some vars

make the scope of item be smaller;
don't assign +1 to MARK when we will shortly overwrite it;
use a local var to to store &GvAV(PL_defgv) to avoid recalculating it
use a _NN variant of SvREFCNT_inc

Shaves 2% off the object size of pp_entersub.

10 years agopp_entersub(): assign CvDEPTH to a local var
David Mitchell [Wed, 26 Feb 2014 18:03:56 +0000 (18:03 +0000)]
pp_entersub(): assign CvDEPTH to a local var

stop repeatedly retrieving it

10 years agopp_entersub(): re-indent block
David Mitchell [Wed, 26 Feb 2014 17:47:47 +0000 (17:47 +0000)]
pp_entersub(): re-indent block

the previous commit wrapped a switch statement in an if(), so re-indent
accordingly. Whitespace-only change.

10 years agotweak pp_entersub
David Mitchell [Wed, 26 Feb 2014 17:38:33 +0000 (17:38 +0000)]
tweak pp_entersub

liberally sprinkle some LIKELY()s, initialise gimme closer to where
it's first needed, and shortcut the common case of a GV with valid CV,
skipping the switch statement.

With gcc and x86_64, this reduces the code size of the function by
about 5%.

10 years agoRemove spurious assert
Steffen Mueller [Thu, 27 Feb 2014 07:22:17 +0000 (08:22 +0100)]
Remove spurious assert

kid is always dereferenced before the assert.

10 years agoRemove leftover Windows 95 / Windows NT4 support code
Steve Hay [Wed, 26 Feb 2014 22:26:45 +0000 (22:26 +0000)]
Remove leftover Windows 95 / Windows NT4 support code

We only support building or running on Windows 2000 or higher, as of the
Windows 95 Chainsaw Massacre commit (8cbe99e5b6). These three chunks of
code escaped the massacre, but the chainsaw has finally caught up with them
now.

10 years agoList-OP removal: Fix compile fail on C90
Steffen Mueller [Wed, 26 Feb 2014 20:51:56 +0000 (21:51 +0100)]
List-OP removal: Fix compile fail on C90

Apologies. I'd applied Reini's patch to my optimization branch. I think
it got lost when I switched to Dave's variant my original code (which
didn't have Reini's C90 fix). Sorry!

10 years agoOptimization: Remove needless list/pushmark pairs from the OP execution
Steffen Mueller [Sat, 22 Feb 2014 09:08:25 +0000 (10:08 +0100)]
Optimization: Remove needless list/pushmark pairs from the OP execution

This is an optimization for OP trees that involve list OPs in list
context. In list context, the list OP's first child, a pushmark, will do
what its name claims and push a mark to the mark stack, indicating the
start of a list of parameters to another OP. Then the list's other
child OPs will do their stack pushing. Finally, the list OP will be
executed and do nothing but undo what the pushmark has done. This is
because the main effect of the list OP only really kicks in if it's
not in array context (actually, it should probably only kick in if
it's in scalar context, but I don't know of any valid examples of
list OPs in void contexts).

This optimization is quite a measurable speed-up for array or hash
slicing and some other situations. Another (contrived) example is
that (1,2,(3,4)) now actually is the same, performance-wise as
(1,2,3,4), albeit that's rarely relevant.

The price to pay for this is a slightly convoluted (by standards other
than the perl core) bit of optimization logic that has to do minor
look-ahead on certain OPs in the peephole optimizer.

A number of tests failed after the first attack on this problem. The
failures were in two categories:

a) Tests that are sensitive to details of the OP tree structure and did
verbatim text comparisons of B::Concise output (ouch). These are just
patched according to the new red in this commit.

b) Test that validly failed because certain conditions in op.c were
expecting OP_LISTs where there are now OP_NULLs (with op_targ=OP_LIST).
For these, the respective conditions in op.c were adjusted.

The change includes modifying B::Deparse to handle the new OP tree
structure in the face of nulled OP_LISTs.

10 years agoMacro for common OP checks: "is this X or was it before NULLing?"
Steffen Mueller [Fri, 21 Feb 2014 17:58:04 +0000 (18:58 +0100)]
Macro for common OP checks: "is this X or was it before NULLing?"

For example,

    if (OP_TYPE_IS_OR_WAS(o, OP_LIST))
        ...

is now available instead of either of the following:

    if ( o
         && ( o->op_type == OP_LIST
              || (o->op_type == OP_NULL
                  && o->op_targ == OP_LIST) ) )
        ...

    if ( o &&
         (o->op_type == OP_NULL ? o->op_targ ? o->op_type) == OP_LIST )
        ...

In case the above logic is a bit unclear: It checks whether that OP is
an OP_LIST or used to be one before being NULLed using op_null.
(FTR, the resulting OP_NULLs have their op_targ set to the old OP type).

This sort of check (and it's reverse "isn't and didn't use to be") are a
relatively common pattern in the part of op.c that tries to intuit
structures from optimization-mangled OP trees. Hopefully, using these
macros will make some code a fair amount clearer.

10 years agoRemove IO::Socket::IP examples as per Porting/Maintainers.pl
Steve Hay [Wed, 26 Feb 2014 08:19:11 +0000 (08:19 +0000)]
Remove IO::Socket::IP examples as per Porting/Maintainers.pl

10 years agoUpdate Pod-Perldoc to CPAN version 3.23
Chris 'BinGOs' Williams [Tue, 25 Feb 2014 11:16:00 +0000 (11:16 +0000)]
Update Pod-Perldoc to CPAN version 3.23

  [DELTA]

3.23 - Sun Feb 23 18:54:43 UTC 2014
    * Release 3.23

    Yes, this is a packaging error. Mea culpa. In the future
    test releases will be 3.23_01, etc.

    See https://twitter.com/frioux/status/429245594180128769
    for context.

3.22_02 - Wed Feb  5 05:08:34 UTC 2014
    * Add a pager that doesn't redirect stdin RT#85173
      Added a special pager environment variable for use
      when perldoc is in the -m mode that doesn't
      redirect STDIN.  Set PERLDOC_SRC_PAGER to use.

      As in:

      PERLDOC_SRC_PAGER=/usr/bin/vim perldoc -m File::Temp

    * Teach ToTerm.pm to get terminal width RT#85467
      Get a terminal width and pass it to Pod::Text::Termcap
      from one of these sources (in order):
          1. An explicit width set from command line with -w
          2. MANWIDTH environment variable
          3. stty output
          4. The default width of 76 (same as Pod::Text)

3.22_01 - Sat Feb  1 05:00:13 UTC 2014
    * Match =item more carefully when scanning perlfunc.
      Fixes RT #86795. Previously matches could be generated
      on words like 'size' and 'precision' which are not
      Perl functions.
    * Cleanup code related to mandoc RT #85844
      Patch by Ingo Schwarze
    * Re-add '-U' flag to skip attempting to drop
      privileges. RT #87837
    * Do not install to INSTALLDIRS after Perl 5.11 RT #89756
    * Refactor search_perlop (finds operators like 'q'
      'qq' 'tr' and others) RT #86506. Previously most of
      the text generated was incorrect.
    * Fix wrong version in DEBUG output from ToTerm.pm RT #85468
    * Fix POD errors when scanning parts of perlfunc RT #86472
      Patch by Shlomi Fish.

10 years agoUpdate CPAN-Meta-YAML to CPAN version 0.012
Chris 'BinGOs' Williams [Tue, 25 Feb 2014 11:10:09 +0000 (11:10 +0000)]
Update CPAN-Meta-YAML to CPAN version 0.012

Includes cc53c151 fix for VMS

  [DELTA]

0.012     2014-02-24 13:07:18-05:00 America/New_York

  - Generated from ETHER/YAML-Tiny-1.61.tar.gz

10 years agoUpdate IO-Socket-IP to CPAN version 0.29
Chris 'BinGOs' Williams [Tue, 25 Feb 2014 11:04:29 +0000 (11:04 +0000)]
Update IO-Socket-IP to CPAN version 0.29

  [DELTA]

  0.29  2014/02/24 16:06:29
        [BUGFIXES]
         * Workaround for OSes that disobey AI_ADDRCONFIG and yield AIs on
           families the kernel will not support anyway (e.g. HPUX)
         * Workaround for OSes that lack getprotobyname() (e.g. Android)

10 years agoFix RT #121321 - Fencepost error causes infinite loop in regex compilation
Yves Orton [Tue, 25 Feb 2014 11:07:18 +0000 (12:07 +0100)]
Fix RT #121321 - Fencepost error causes infinite loop in regex compilation

Due to a fencepost error if a pattern had more than 9 capture buffers
and after the last capture buffer there was an octal style escape which
when interpreted as decimal evaluated to one more than the number of
defined buffers then the regex compiler would go into an infinite loop.

This fixes the fencepost error, adds tests, and adds some comments to
explain what is going on.

10 years agoUse a temporary file instead of $^X when testing stat.
Nicholas Clark [Tue, 25 Feb 2014 10:36:26 +0000 (11:36 +0100)]
Use a temporary file instead of $^X when testing stat.

Otherwise there's a subtle race condition on the last access time, which can
cause the test to spuriously fail. I'm surprised that we've not seen this
failure until today.

10 years agoSilence some VC++ compiler warnings
Steve Hay [Tue, 25 Feb 2014 08:59:07 +0000 (08:59 +0000)]
Silence some VC++ compiler warnings

gv.c(1455) : warning C4146: unary minus operator applied to unsigned type, result still unsigned
gv.c(1586) : warning C4146: unary minus operator applied to unsigned type, result still unsigned
gv.c(2122) : warning C4146: unary minus operator applied to unsigned type, result still unsigned
toke.c(12423) : warning C4244: '=' : conversion from 'I32' to 'char', possible loss of data
win32.c(3017) : warning C4022: 'SetHandleInformation' : pointer mismatch for actual parameter 1
win32.c(2971) : warning C4101: 'old_h' : unreferenced local variable
win32.c(2967) : warning C4101: 'oldfd' : unreferenced local variable

10 years agolib/locale.t: Make more tests not fail unless is bad for enough locales
Karl Williamson [Mon, 24 Feb 2014 19:00:03 +0000 (12:00 -0700)]
lib/locale.t: Make more tests not fail unless is bad for enough locales

locale.t has some tests that fail even one locale fails; and it has some
tests where failure doesn't happen unless a sufficient percentage of
locales have the same problem.

The first set should be for tests whose failure indicates a basic
problem in locale handling; and the second set should be for tests where
it could be that just a locale definition is bad.

Prior to this patch, tests dealing with radix problems were considered
in the first category, but in fact it's possible that just the locale
definition for the radix is wrong.  This is what happened for some older
Darwin versions for their Basque locales, which caused locale.t to show
failures, whereas it was just these locales that were bad, and the
generic handling was ok, or good enough.  (The actual failures had the
radix be the two character string: apostrophe followed by a blank.  It
would be a lot of work to make Perl deal with having a quote character
also mean a decimal point, and that work isn't worth it, especially as
this was a locale definition error, and we don't know of any locale in
the world where an apostrophe is legitimately a radix character.)

For this commit, I looked through the tests, and I added the tests where
it seemed that the problem could just be a bad locale definition to the
list of such tests.  Note that failures here could mean an internal Perl
error, but in that case, it should affect many more locales, so will
show up anyway as the failure rate should exceed the acceptable one.

10 years agolib/locale.t: Change an array to a hash
Karl Williamson [Mon, 24 Feb 2014 18:56:47 +0000 (11:56 -0700)]
lib/locale.t: Change an array to a hash

This is more naturally a hash in that it is a list of numbers, not
necessarily consecutive, and each time through the loop the same number
was getting pushed, so had multiple entries for each by the time it was
finished.

10 years agoMissing version bump for Deparse
Steffen Mueller [Mon, 24 Feb 2014 17:07:16 +0000 (18:07 +0100)]
Missing version bump for Deparse

Not a good run, I am having. But also not anything tangible
that our silly tests caught me on. :(

10 years agoTest fix: Update list of B::Concise functions
Steffen Mueller [Mon, 24 Feb 2014 17:00:08 +0000 (18:00 +0100)]
Test fix: Update list of B::Concise functions

Imagine there was a test that actually broken open a core module's
package and looked at all of its subs and compared it to a hardcoded
list of "constant" and "xs" functions. That would be madness, wouldn't
it? Breaking encapsulation, no less? Require tedious synchronization?

m(

10 years agoB::Deparse: Padrange deparse fix
Steffen Mueller [Mon, 24 Feb 2014 13:39:08 +0000 (14:39 +0100)]
B::Deparse: Padrange deparse fix

The PADRANGE support fakes up a PUSHMARK OP but until this commit, it
did so incompletely since it never overrode the OP type (that was still
an OP_PADRANGE). This addresses that.

On top of it, there's two minor changes that switch from "eq" to "=="
for comparing numeric OP types.

10 years agofix RT #121299 - Inconsistent behavior with backreferences nested inside subpattern...
Yves Orton [Sun, 23 Feb 2014 19:53:51 +0000 (20:53 +0100)]
fix RT #121299 - Inconsistent behavior with backreferences nested inside subpattern references

Match variables should be dynamically scoped during GOSUB and GOSTART.
The callers state should be inherited by the callee, but once the callee
returns, the callers state should be restored.

This is different from EVAL, where the callers and callees state are
expected to not be the same (although might be the same), and where
the "reasonable" match semantics differ. Currently the following two
one liners will produce different results:

$ ./perl -Ilib -le'"<ab><>>" =~/ < (?: \1 | [ab]+ ) (>) (?0)? /x and print $&;'
<ab><>>

$ ./perl -Ilib -le'$qr= qr/ < (?: \1 | [ab]+ ) (>) (??{ $qr })? /x; "<ab><>>" =~ m/$qr/ and print $&;'
<ab>

While I think reasonable people could argue that we should special case
things when we know that the return from (??{ ... }) is the same as the
currently executing pattern I think explaining the difference would be
harder than necessary.

On the contrary making GOSUB/GOSTART exactly the same as EVAL, so that
the match vars were totally independent seems to throw away an
opportunity for much more powerful semantics than can be offered by
EVAL.

10 years agoImprove how regprop dumps REF-like nodes during execution
Yves Orton [Sun, 23 Feb 2014 17:59:48 +0000 (18:59 +0100)]
Improve how regprop dumps REF-like nodes during execution

We pass in the regmatch_info struct, which allows us to dump
what a given REF is going to match.

10 years agocomments and whitespace fixups to inprove clarity of the code
Yves Orton [Fri, 21 Feb 2014 11:54:02 +0000 (12:54 +0100)]
comments and whitespace fixups to inprove clarity of the code

10 years agotest nit in CPAN-Meta-YAML/t/31_local_tml.t
Craig A. Berry [Mon, 24 Feb 2014 02:47:07 +0000 (20:47 -0600)]
test nit in CPAN-Meta-YAML/t/31_local_tml.t

Directories on VMS have a .DIR extension.  This test appears to be
constructing method names from directory names, so we need to trim off
the extension to get it to pass.

Awaiting upstream application at:

https://rt.cpan.org/Public/Bug/Display.html?id=93297

10 years agofix win32 build
David Mitchell [Sun, 23 Feb 2014 16:04:38 +0000 (16:04 +0000)]
fix win32 build

dca36a0cc embedded #ifdefs within a macro call, which is naughty (I
think). So have the ifdef outside the macro instead

10 years ago[perl #121259] Always allow COW after $input=<>
Father Chrysostomos [Mon, 17 Feb 2014 06:25:27 +0000 (22:25 -0800)]
[perl #121259] Always allow COW after $input=<>

sv_grow provides an extra byte for the sake of copy-on-write’s buffer
reference count, but skips this for multiples of 256 (though the com-
ments there say powers of two).

When we do

    $input=<>

The assignment is optimised away and the allocation takes place in
sv_gets.  In that code path, we know we don’t need a nice power of
two and allocating an extra byte won’t hurt, so go ahead and add an
extra byte.

This speeds up code doing m//g on $input, because it avoids the pre-
match copy.

10 years agoModule-CoreList 3.07 released to CPAN, bump core version to 3.08
Chris 'BinGOs' Williams [Fri, 21 Feb 2014 16:08:01 +0000 (16:08 +0000)]
Module-CoreList 3.07 released to CPAN, bump core version to 3.08

10 years agoFix syncing of Config-Perl-V with CPAN version 0.20
Steve Hay [Fri, 21 Feb 2014 08:37:37 +0000 (08:37 +0000)]
Fix syncing of Config-Perl-V with CPAN version 0.20

Commit d0fa2fb96e removed some erroneous changes made by commit 0b39d4dc4a
but didn't quite restore 21_plv518.t to match the CPAN version.

10 years agoUpgrade HTTP-Tiny from version 0.042 to 0.043
Steve Hay [Fri, 21 Feb 2014 08:12:35 +0000 (08:12 +0000)]
Upgrade HTTP-Tiny from version 0.042 to 0.043

10 years agoperldelta for 257518b902
Tony Cook [Fri, 21 Feb 2014 04:15:26 +0000 (15:15 +1100)]
perldelta for 257518b902

10 years agobump $base::VERSION to 2.22
Tony Cook [Mon, 17 Feb 2014 04:21:34 +0000 (15:21 +1100)]
bump $base::VERSION to 2.22

10 years ago[perl #121196] only examine the name being included
Tony Cook [Mon, 17 Feb 2014 04:19:34 +0000 (15:19 +1100)]
[perl #121196] only examine the name being included

Checking the location called from broke require overrides.

10 years agoperldelta for 3e63bed3c5, 58572ed82f
Tony Cook [Fri, 21 Feb 2014 03:47:05 +0000 (14:47 +1100)]
perldelta for 3e63bed3c558572ed82f

10 years agoUpdate Module-Load to CPAN version 0.32
Chris 'BinGOs' Williams [Thu, 20 Feb 2014 23:31:43 +0000 (23:31 +0000)]
Update Module-Load to CPAN version 0.32

  [DELTA]

0.32    Thu Feb 20 22:53:19 GMT 2014
* Fix tests to support statically built perls

10 years agoOnly define Perl__get_regclass_nonbitmap_data once.
Craig A. Berry [Thu, 20 Feb 2014 22:25:28 +0000 (16:25 -0600)]
Only define Perl__get_regclass_nonbitmap_data once.

It was added in 77d654fbc7477bd but since it is exported, it
should not be defined in both the core and the extension versions
of regex code.  Doing so causes a multiply defined symbol warning
in the VMS linker and results in a build failure.  It might cause
trouble in any other environment with a strict linker.

10 years ago[perl #120939] at least fix the leak in const_av_xsub
Tony Cook [Thu, 20 Feb 2014 22:12:58 +0000 (09:12 +1100)]
[perl #120939] at least fix the leak in const_av_xsub

10 years agoUpdate ExtUtils-MakeMaker to CPAN version 6.90
Chris 'BinGOs' Williams [Thu, 20 Feb 2014 20:56:46 +0000 (20:56 +0000)]
Update ExtUtils-MakeMaker to CPAN version 6.90

  [DELTA]

6.90 Thu Feb 20 20:46:04 GMT 2014

    No changes from 6.89_01

6.89_01 Mon Feb 17 15:56:39 GMT 2014
    Bug fixes:
    * Libraries are not transitive on Android

10 years agoRestore proper functioning of -Mdiagnostics
Karl Williamson [Thu, 20 Feb 2014 18:29:15 +0000 (11:29 -0700)]
Restore proper functioning of -Mdiagnostics

Commit 1c604e7c7f fixed some pod errors, but broke

./perl -Ilib -Mdiagnostics -e '$/=[]'

This fixes that.

10 years agoChange 'semantics' to 'rules'
Karl Williamson [Thu, 20 Feb 2014 18:10:39 +0000 (11:10 -0700)]
Change 'semantics' to 'rules'

The term 'semantics' in documentation when applied to character sets is
changed to 'rules' as being a shorter less-jargony synonym in this case.
This was discussed several releases ago, but I didn't get around to it.

10 years agoChange av_len calls to av_tindex for clarity
Karl Williamson [Thu, 20 Feb 2014 17:28:58 +0000 (10:28 -0700)]
Change av_len calls to av_tindex for clarity

av_tindex is a more clearly named synonym for av_len, available starting
in v5.18.  This changes the core uses to it, including modules in /ext,
which are not dual-lifed.

10 years agoBump version numbers
Karl Williamson [Thu, 20 Feb 2014 17:23:23 +0000 (10:23 -0700)]
Bump version numbers

These four core-only modules are about to be changed so that they call
av_tindex instead of av_len.  There's no chance that any of the version
numbers will need to be reverted, as we think that bumping a single-life
module's version is harmless.

10 years agoUpdate ribasushi's e-mail address.
Nicholas Clark [Thu, 20 Feb 2014 15:54:09 +0000 (16:54 +0100)]
Update ribasushi's e-mail address.

10 years agoFix pod typo (kentnl++)
Peter Rabbitson [Thu, 20 Feb 2014 15:14:42 +0000 (16:14 +0100)]
Fix pod typo (kentnl++)

10 years agoOne typo fix was missed in upgrading Config::Perl::V to 0.20
H.Merijn Brand [Thu, 20 Feb 2014 11:00:15 +0000 (12:00 +0100)]
One typo fix was missed in upgrading Config::Perl::V to 0.20

The modified for blead change has been reverted
The -V output as checked for 5.10.x and 5.18.x will not change
with changes in blead.

I will add new test files for all most recent maint releases
and will add one for 5.10.0 when it is out

10 years agoModule-CoreList 3.06 released to CPAN
Chris 'BinGOs' Williams [Thu, 20 Feb 2014 10:54:58 +0000 (10:54 +0000)]
Module-CoreList 3.06 released to CPAN

10 years agoAmend Porting/core-cpan-diff
H.Merijn Brand [Thu, 20 Feb 2014 10:37:47 +0000 (11:37 +0100)]
Amend Porting/core-cpan-diff

Allow -v with -x
Show diff for customized scripts when -d and -v
Allow -v #
Set -d if -v 3 and up

10 years agoprepare Module::CoreList for next release
Tony Cook [Thu, 20 Feb 2014 07:10:51 +0000 (18:10 +1100)]
prepare Module::CoreList for next release

10 years agobump to version 5.19.10 and fix the version number reference in op.c
Tony Cook [Thu, 20 Feb 2014 05:32:01 +0000 (16:32 +1100)]
bump to version 5.19.10 and fix the version number reference in op.c

10 years agonew perldelta for 5.19.10
Tony Cook [Thu, 20 Feb 2014 05:06:18 +0000 (16:06 +1100)]
new perldelta for 5.19.10

10 years agoavoid leaving the old perldelta as a symlink
Tony Cook [Thu, 20 Feb 2014 05:02:57 +0000 (16:02 +1100)]
avoid leaving the old perldelta as a symlink

In a built tree, the name we copy perldelta.pod to is a symlink to
perldelta.pod, and if you blindly follow the git adds, you end up
adding a symlink to the commit.

unlink() the name we're about to overwrite before we overwrite it to
prevent that.

10 years agorecord the 5.19.9 epigraph
Tony Cook [Thu, 20 Feb 2014 04:56:00 +0000 (15:56 +1100)]
record the 5.19.9 epigraph

10 years agomerge 5.19.9 release branch
Tony Cook [Thu, 20 Feb 2014 04:40:24 +0000 (15:40 +1100)]
merge 5.19.9 release branch

10 years agoregcomp.c: Don't read uninitialized data
Karl Williamson [Thu, 20 Feb 2014 04:14:44 +0000 (21:14 -0700)]
regcomp.c: Don't read uninitialized data

I keep forgetting that the OP of a regnode is not defined in Pass 1 of
the regex compiler.  This is likely the cause of inconsistent results in
lib/locale.t, as valgrind shows there to be a read of uninitialized
data before this patch, and the result is randomly tainting when there
shouldn't be, consistent with the test failures.

10 years agonote lib/locale.t rare failure v5.19.9
Tony Cook [Thu, 20 Feb 2014 03:24:53 +0000 (14:24 +1100)]
note lib/locale.t rare failure

10 years agoupdate perlhist for 5.19.9
Tony Cook [Thu, 20 Feb 2014 02:50:08 +0000 (13:50 +1100)]
update perlhist for 5.19.9

10 years agofinalize perldelta for 5.19.9
Tony Cook [Thu, 20 Feb 2014 02:44:11 +0000 (13:44 +1100)]
finalize perldelta for 5.19.9

10 years agoUpdate Module::CoreList for 5.19.9
Tony Cook [Thu, 20 Feb 2014 00:22:22 +0000 (11:22 +1100)]
Update Module::CoreList for 5.19.9

10 years agolib/locale.t: Remove tests that need UTF-8 locale
Karl Williamson [Thu, 20 Feb 2014 00:11:33 +0000 (17:11 -0700)]
lib/locale.t: Remove tests that need UTF-8 locale

These tests should not be here because they will only match under a
UTF-8 locale, which happens to be the case on the machine I developed
them on, but not necessarily always true, and so they are failing.

Given the deadline is already past, I'm just removing them for now, and
will re-add them later in another place in the file where we know we
are using a UTF-8 locale.

10 years agolocale.c: Change 'and' to '&&'
Karl Williamson [Wed, 19 Feb 2014 22:39:18 +0000 (15:39 -0700)]
locale.c: Change 'and' to '&&'

To actually compile on Windows

10 years agorun/locale.t: White-space only
Karl Williamson [Wed, 19 Feb 2014 22:33:00 +0000 (15:33 -0700)]
run/locale.t: White-space only

Align a column

10 years agolocale.c: Another POSIX emulation fix on Windows
Karl Williamson [Wed, 19 Feb 2014 22:31:07 +0000 (15:31 -0700)]
locale.c: Another POSIX emulation fix on Windows

Right after I pushed the previous commit, I realized that the system
default locale on Windows should also have lower priority (besides LANG)
than the LC_foo environment variables.  This should do that.

10 years ago.locale.c: Better emulate POSIX locale setting on Windows
Karl Williamson [Wed, 19 Feb 2014 21:55:29 +0000 (14:55 -0700)]
.locale.c: Better emulate POSIX locale setting on Windows

Commit b385bb4ddcb252e69a1044d702646741e2e489fb introduced
my_setlocale() compiled only under Windows which emulates the POSIX
rules for setting the locale.  It differs from Windows only if the
locale passed in is "".  Unfortunately it was buggy if the category
being set was LC_ALL, and there is a LANG environment variable.  LANG
has lower precedence than the other environment variables, like
LC_NUMERIC, but my_setlocale() was giving it higher priority when set
through LC_ALL.

This should solve the problems being seen since
7cd8b56846670e577e1f62479eab8f38fb11da14

10 years agoMake taint checking regex compile time instead of runtime
Karl Williamson [Tue, 18 Feb 2014 19:59:26 +0000 (12:59 -0700)]
Make taint checking regex compile time instead of runtime

See discussion at https://rt.perl.org/Ticket/Display.html?id=120675
There are several unresolved  items in this discussion, but we did agree
that tainting should be dependent only on the regex pattern, and not the
particular input string being matched against:

"The bottom line is we are moving to the policy that tainting is based
on the operation being in locale, without regard to the particular
operand's contents passed this time to the operation. This means simpler
core code and more consistent tainting results. And it lessens the
likelihood that there are paths in the core that should taint but don't"

This commit does the minimal work to change regex pattern matching to
determine tainting at pattern compilation time.  Simply put, if a
pattern contains a regnode whose match/not match depends on the run-time
locale, any attempt to match against that pattern will taint, regardless
of the actual target string or runtime locale in effect.  Given this
change, there are optimizations that can be made to avoid runtime work,
but these are deferred until later.

Note that just because a regular expression is compiled under locale
doesn't mean that the generated pattern will be tainted.  It depends on
the actual pattern.  For example, the pattern /(.)/ doesn't taint
because it will match exactly one character of the input, regardless of
locale settings.

10 years agolib/locale.t: Add some test names
Karl Williamson [Tue, 18 Feb 2014 18:37:10 +0000 (11:37 -0700)]
lib/locale.t: Add some test names

10 years agolib/locale.t: Untaint before checking if next thing taints
Karl Williamson [Tue, 18 Feb 2014 18:45:48 +0000 (11:45 -0700)]
lib/locale.t: Untaint before checking if next thing taints

The tests weren't testing what they purported to, as we should be sure
to start with untained values to see if the operation taints.

10 years agoperllocale: Add note about ENVIRONMENT variable
Karl Williamson [Wed, 19 Feb 2014 16:37:51 +0000 (09:37 -0700)]
perllocale: Add note about ENVIRONMENT variable

This variable is part of the environment, but wasn't previously
mentioned.

10 years agoperlsec: Nit
Karl Williamson [Wed, 19 Feb 2014 16:36:39 +0000 (09:36 -0700)]
perlsec: Nit