This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perl5.git
9 years agoUpdate Digest-MD5 to CPAN version 2.54
Chris 'BinGOs' Williams [Tue, 13 Jan 2015 00:23:00 +0000 (00:23 +0000)]
Update Digest-MD5 to CPAN version 2.54

  [DELTA]

2015-01-12   Gisle Aas <gisle@ActiveState.com>

   Release 2.54

   David Mitchell: silence some compiler warnings
   Jonathan Hall: Add ->context() feature
   Steve Hay: Sync with blead
   bulk88: const the vtable
   zefram: 5.6 threads test fix

9 years agoperl.c: silence compiler warning:
David Mitchell [Mon, 12 Jan 2015 16:36:51 +0000 (16:36 +0000)]
perl.c: silence compiler warning:

perl.c:3629:75: warning: value computed is not used [-Wunused-value]
     gv_SVadd(PL_errgv);

9 years agoTest for nan range ends.
Jarkko Hietaniemi [Mon, 12 Jan 2015 03:57:37 +0000 (22:57 -0500)]
Test for nan range ends.

9 years agoDetect infnan range ends.
Jarkko Hietaniemi [Mon, 12 Jan 2015 03:58:35 +0000 (22:58 -0500)]
Detect infnan range ends.

9 years agoSeparate bad range end detection.
Jarkko Hietaniemi [Mon, 12 Jan 2015 03:58:15 +0000 (22:58 -0500)]
Separate bad range end detection.

9 years agoTest for inf range ends.
Jarkko Hietaniemi [Mon, 12 Jan 2015 03:27:45 +0000 (22:27 -0500)]
Test for inf range ends.

9 years agoExplicitly test x infnan producing empty string.
Jarkko Hietaniemi [Mon, 12 Jan 2015 03:18:00 +0000 (22:18 -0500)]
Explicitly test x infnan producing empty string.

9 years agoUpdate IO-Socket-IP to CPAN version 0.36
Chris 'BinGOs' Williams [Mon, 12 Jan 2015 11:02:38 +0000 (11:02 +0000)]
Update IO-Socket-IP to CPAN version 0.36

  [DELTA]

0.36    2014/01/10 20:54:58
        [BUGFIXES]
         * Always bind() on MSWin32 because Windows doesn't like it if we
           listen() having not done so (RT101396)

9 years agoUpdate Digest-SHA to CPAN version 5.95
Chris 'BinGOs' Williams [Mon, 12 Jan 2015 11:01:41 +0000 (11:01 +0000)]
Update Digest-SHA to CPAN version 5.95

  [DELTA]

5.95  Sat Jan 10 12:15:36 MST 2015
  - modified the bit-ordering test (ref. t/bitorder.t)
    -- supplied directory-change preamble for CORE builds

9 years agoperldelta for e0c6a6b8c9
Father Chrysostomos [Mon, 12 Jan 2015 06:28:18 +0000 (22:28 -0800)]
perldelta for e0c6a6b8c9

9 years agoperldelta for 08b999a9d / #123452
Father Chrysostomos [Mon, 12 Jan 2015 06:25:51 +0000 (22:25 -0800)]
perldelta for 08b999a9d / #123452

9 years agoperldelta for 2384afee9 / #123553
Father Chrysostomos [Mon, 12 Jan 2015 06:21:56 +0000 (22:21 -0800)]
perldelta for 2384afee9 / #123553

9 years agoperldelta for 307cbb9fc
Father Chrysostomos [Mon, 12 Jan 2015 06:18:12 +0000 (22:18 -0800)]
perldelta for 307cbb9fc

9 years agoperldelta for f605e527
Father Chrysostomos [Mon, 12 Jan 2015 06:14:00 +0000 (22:14 -0800)]
perldelta for f605e527

9 years agoperldelta for eb4ec35b34 / #123514
Father Chrysostomos [Mon, 12 Jan 2015 06:11:56 +0000 (22:11 -0800)]
perldelta for eb4ec35b34 / #123514

9 years agoperldelta for 1d51ab6ca
Father Chrysostomos [Mon, 12 Jan 2015 06:09:20 +0000 (22:09 -0800)]
perldelta for 1d51ab6ca

9 years agoperldelta for d8bd3d828 / #123495
Father Chrysostomos [Mon, 12 Jan 2015 06:05:33 +0000 (22:05 -0800)]
perldelta for d8bd3d828 / #123495

9 years agoperldelta for fd8be4a16
Father Chrysostomos [Mon, 12 Jan 2015 06:03:21 +0000 (22:03 -0800)]
perldelta for fd8be4a16

9 years agoperldelta for 3c6ef0a5 / #103260 / #123071
Father Chrysostomos [Mon, 12 Jan 2015 05:47:34 +0000 (21:47 -0800)]
perldelta for 3c6ef0a5 / #103260 / #123071

9 years agoperldelta for 58480c3bb
Father Chrysostomos [Mon, 12 Jan 2015 05:44:53 +0000 (21:44 -0800)]
perldelta for 58480c3bb

9 years agoperldelta for 62ae7cfb674910
Father Chrysostomos [Mon, 12 Jan 2015 05:44:13 +0000 (21:44 -0800)]
perldelta for 62ae7cfb674910

9 years agoperldelta for 2e4af4cf6b
Father Chrysostomos [Mon, 12 Jan 2015 05:38:07 +0000 (21:38 -0800)]
perldelta for 2e4af4cf6b

9 years agoCorrect perl ver in Safe Changes
Father Chrysostomos [Mon, 12 Jan 2015 05:34:06 +0000 (21:34 -0800)]
Correct perl ver in Safe Changes

9 years agorefactor op.c S_bad_type_*v
Daniel Dragan [Thu, 1 Jan 2015 04:09:28 +0000 (23:09 -0500)]
refactor op.c S_bad_type_*v

-flags arg of both funcs is unused in all callers. Move the 0 to the funcs.
 flags arg is from commit ce16c625ec in 2012
-all bad_type_gv calls are right before the end of the switch, the pushing
 of 1st 3 args and call asm ops can be merged together, leaving the 1
 string constant push as the only unique op between the 7 src code
 callers of bad_type_gv, this requires reordering the args so the only
 unique one is the last/right most one, reordering can't be done to
 bad_type_pv because each following execution point after each bad_type_pv
 is different, bad_type_pv's caller/s are not a switch statement
- commit 53e06cf030 probably overlooked the 2 PL_op_desc[type] places,
  OP_DESC is a fancier superset of PL_op_desc[type], since calling
  bad_type_pv only happens during a PP syntax error, that is not
  performance critical, so replace PL_op_desc[type] with OP_DESC and
  factor out OP to description string lookup, plus custom ops are very rare
  so this shouldn't impact the error message seen by the user

VC2003 .text section of perl521.dll before 0xc9543 after 0xC9523

9 years agoConfused cloning of nested state subs
Father Chrysostomos [Mon, 12 Jan 2015 04:39:03 +0000 (20:39 -0800)]
Confused cloning of nested state subs

use feature 'lexical_subs','state';
no warnings 'experimental';
my $sub = sub{
    state sub sb4;
    state sub a {
        state $x = 42;
        sub sb4 { $x; }
    }
    a();
    print sb4(), "\n";
};
$sub->();

The output:

Bizarre copy of CODE in subroutine exit at - line 10.

The sb4 sub was trying to close over the wrong pad; namely, the one
belonging to the anonymous sub.

9 years agoperldiag grammo
Father Chrysostomos [Mon, 12 Jan 2015 04:08:12 +0000 (20:08 -0800)]
perldiag grammo

9 years agoCatch infnan repeat counts.
Jarkko Hietaniemi [Mon, 12 Jan 2015 01:05:34 +0000 (20:05 -0500)]
Catch infnan repeat counts.

Not entirely convinced this is worth the extra code but getting
"Negative repeat count" warning for NaN repeat count is too much.

Even before this patch, "a" x $Inf didn't go all Genghis over your
virtual memory.  This is all about the right warning.

9 years agoWin32: stat() only after a failed open() on a module
Daniel Dragan [Thu, 8 Jan 2015 05:10:13 +0000 (00:10 -0500)]
Win32: stat() only after a failed open() on a module

See RT ticket for this patch for details.

9 years agoAdd missing =item * in perldelta (now perl5217delta) from commit 070733dfda
Steve Hay [Sat, 10 Jan 2015 16:17:19 +0000 (16:17 +0000)]
Add missing =item * in perldelta (now perl5217delta) from commit 070733dfda

9 years agoCorrect a bug number in perldelta
Steve Hay [Sat, 10 Jan 2015 16:09:36 +0000 (16:09 +0000)]
Correct a bug number in perldelta

9 years agoperldelta for 285727d0e3
Steve Hay [Sat, 10 Jan 2015 15:39:08 +0000 (15:39 +0000)]
perldelta for 285727d0e3

9 years agoBump $VERSION following previous commit
Steve Hay [Sat, 10 Jan 2015 15:35:27 +0000 (15:35 +0000)]
Bump $VERSION following previous commit

The code is currently identical to 0.23, but when the next change is made
the $VERSION must not be bumped to 0.24 since that has already been
released. For the same reason, we can't use 0.24 now, so bump to 0.25.

9 years agoRevert "fix attributes memcmp without len<6 (asan catch)"
Steve Hay [Sat, 10 Jan 2015 15:29:26 +0000 (15:29 +0000)]
Revert "fix attributes memcmp without len<6 (asan catch)"

This reverts commit ff5314c5aa54b172122507017cac034acf1c4bf7.

As noted by Andy Dougherty in #122629 the problem that this fixes
was already fixed more succinctly in dd369969a/#122701.

9 years agoperldelta for [perl #123530]
Karl Williamson [Thu, 8 Jan 2015 21:36:00 +0000 (14:36 -0700)]
perldelta for [perl #123530]

9 years agoPOSIX.pod: Various nits, typos, clarifications
Karl Williamson [Thu, 8 Jan 2015 20:49:56 +0000 (13:49 -0700)]
POSIX.pod: Various nits, typos, clarifications

9 years agoperlpodspec: Corrections/adds to detecting =encoding
Karl Williamson [Thu, 8 Jan 2015 19:22:21 +0000 (12:22 -0700)]
perlpodspec: Corrections/adds to detecting =encoding

C0 and C1 are not legal UTF-8 start bytes.  utf8::decode() is a more
accurate way of determining UTF-8.

9 years agotoke.c: White-space only
Karl Williamson [Thu, 8 Jan 2015 19:16:50 +0000 (12:16 -0700)]
toke.c: White-space only

Outdent a block that was indented by 2 tab widths.

9 years agoActually remove the TODO rather than just the block
Chris 'BinGOs' Williams [Sat, 10 Jan 2015 12:24:02 +0000 (12:24 +0000)]
Actually remove the TODO rather than just the block

9 years agoUpdate Digest-SHA to CPAN version 5.94
Chris 'BinGOs' Williams [Sat, 10 Jan 2015 11:59:43 +0000 (11:59 +0000)]
Update Digest-SHA to CPAN version 5.94

  [DELTA]

5.94  Sat Jan 10 00:45:28 MST 2015
  - added support for threaded builds
    -- PERL_GET_NO_CONTEXT, pTHX_, aTHX_, etc.
    -- employed 'const' storage class where possible
    -- ref. rt.cpan.org #101260
  - simplified shabits() routine (bitwise input buffering)
    -- slightly less efficient but easier to understand
    -- ref. rt.cpan.org #101344
  - minor documentation tweaks and additions

9 years agoRemoved TODO from pm_to_lib test in EUMM
Chris 'BinGOs' Williams [Fri, 9 Jan 2015 22:21:58 +0000 (22:21 +0000)]
Removed TODO from pm_to_lib test in EUMM

And upstream fix for race condition applied

https://github.com/Perl-Toolchain-Gang/ExtUtils-MakeMaker/commit/6f41d63

9 years agoSimplify s/// and tr/// parsing logic
Father Chrysostomos [Fri, 9 Jan 2015 02:49:32 +0000 (18:49 -0800)]
Simplify s/// and tr/// parsing logic

These two operators were being translated into subst("","") and
tr("","") by the lexer.  Then pmruntime in op.c would take apart the
resulting list op.  Instead of constructing a list op only to take it
apart again, feed the replacement part to pmruntime separately.  We
can achieve this by introducing a new token ('/') that the parser rec-
ognizes as introducing a replacement.

If we had followed this approach to begin with, then bug #123542 would
never have happened.

(Actually, it seems the parser did know about the replacement part to
begin with, but it changed in perl-5.8.0-4047-g131b3ad to fix some
overloading problems.)

9 years agoparser.t: Correct bug number
Father Chrysostomos [Fri, 9 Jan 2015 02:00:35 +0000 (18:00 -0800)]
parser.t: Correct bug number

9 years agoUpdate ExtUtils-Command to CPAN version 1.20
Chris 'BinGOs' Williams [Thu, 8 Jan 2015 21:50:05 +0000 (21:50 +0000)]
Update ExtUtils-Command to CPAN version 1.20

  [DELTA]

1.20  Thu, Jan 8, 2015
  - Skip some tests on Haiku as well

9 years agoparser.t: Correct skip count
Father Chrysostomos [Thu, 8 Jan 2015 17:23:50 +0000 (09:23 -0800)]
parser.t: Correct skip count

I increased the skip count in 08b999a9 by mistake.  For crashing bugs,
executing the code that would have crashed is sufficient to test it.

9 years agoFix apidocs for OP_TYPE_IS(_OR_WAS) - arguments separated by |, not ,.
Matthew Horsfall (alh) [Thu, 8 Jan 2015 13:41:24 +0000 (08:41 -0500)]
Fix apidocs for OP_TYPE_IS(_OR_WAS) - arguments separated by |, not ,.

This was causing Devel::PPPort's tooling some grief.

9 years ago[perl #123452] Fix crash with s/${<>{})//
Father Chrysostomos [Thu, 8 Jan 2015 03:33:39 +0000 (19:33 -0800)]
[perl #123452] Fix crash with s/${<>{})//

s/foo/bar/ tokenizes as something akin to subst("foo","bar") and the
resulting list op representing the contents of the parentheses is
passed to pmruntime as its expr argument.

If we have invalid code like s/${<>{})//, the bison parser will dis-
card invalid tokens until it finds something it can fall back to, in
an attempt to keep parsing (to report as many errors as possible).

In the process of discarding tokens, it may convert s/${<>{})//, which
the lexer emits like this:

    PMFUNC ( $ { THING(readline) { } ) , "" )

into this:

    PMFUNC ( $ { THING(readline) } ) , "" )

(or something similar).  So when the parser sees the first closing
parentheses, it decides it has a complete PMFUNC(...), and the expr
argument to pmruntime ends up being an rv2sv op (the ${...}), not
a list op.

pmruntime assumes it is a list op, and tries to access its op_last
field, to find the replacement part; but rv2sv has no op_last field,
so this reads past the end of the op struct, usually into the first
pointer in the next op slot, which itself is an opslot pointer, not an
op pointer, so things really screw up.

If we check that the arguments to subst are indeed a list op first
before trying to extract the replacement part, everything works.  We
get the syntax errors reported as expected, but no crash.

9 years agoUpgrade Devel::PPPort from 3.25 to 3.26 (to silence build warnings)
Matthew Horsfall (alh) [Thu, 8 Jan 2015 02:45:44 +0000 (21:45 -0500)]
Upgrade Devel::PPPort from 3.25 to 3.26 (to silence build warnings)

Thanks to Dave M. for the patches.

9 years ago[-Dusecbacktrace] Close the BFD descriptor.
Jarkko Hietaniemi [Thu, 8 Jan 2015 01:12:51 +0000 (20:12 -0500)]
[-Dusecbacktrace] Close the BFD descriptor.

Otherwise we leak several dozens of megabytes, if not more,
for each Perl_dump_c_backtrace().

9 years agoAdd Andreas Voegele to AUTHORS
Father Chrysostomos [Wed, 7 Jan 2015 22:05:49 +0000 (14:05 -0800)]
Add Andreas Voegele to AUTHORS

9 years agoAdd test for rt#123556
Andreas Voegele [Wed, 7 Jan 2015 19:36:14 +0000 (20:36 +0100)]
Add test for rt#123556

9 years agoOnly compare defined values with "ge" in Module::CoreList::first_release_raw
Andreas Voegele [Tue, 6 Jan 2015 11:05:14 +0000 (12:05 +0100)]
Only compare defined values with "ge" in Module::CoreList::first_release_raw

9 years agoperly.c: Emit nl after ‘Reading a token’
Father Chrysostomos [Wed, 7 Jan 2015 19:01:59 +0000 (11:01 -0800)]
perly.c: Emit nl after ‘Reading a token’

This makes the -DTp output easier to read.

9 years agoop.c: Remove dVAR from ck_grep
Father Chrysostomos [Wed, 7 Jan 2015 18:01:14 +0000 (10:01 -0800)]
op.c: Remove dVAR from ck_grep

It has not needed it since 3253bf854 make it call S_alloc_LOGOP
instead of accessing PL_ppaddr directly.

9 years agoop.c: Remove dVAR from newRANGE
Father Chrysostomos [Wed, 7 Jan 2015 18:00:46 +0000 (10:00 -0800)]
op.c: Remove dVAR from newRANGE

It has not needed it since 3253bf854 make it call S_alloc_LOGOP
instead of accessing PL_ppaddr directly.

9 years agoop.c: Remove dVAR from pmruntime
Father Chrysostomos [Wed, 7 Jan 2015 18:00:07 +0000 (10:00 -0800)]
op.c: Remove dVAR from pmruntime

It has not needed it since 3253bf854 make it call S_alloc_LOGOP
instead of accessing PL_ppaddr directly.

9 years agoTEST: Comment for 804352e2
Father Chrysostomos [Wed, 7 Jan 2015 17:54:52 +0000 (09:54 -0800)]
TEST: Comment for 804352e2

9 years agoAvoid glob in t/TEST on non-Windows
Father Chrysostomos [Wed, 7 Jan 2015 17:48:30 +0000 (09:48 -0800)]
Avoid glob in t/TEST on non-Windows

See ticket #123561.  The presence of ‘glob’ was causing perl to
attempt to File::Glob at compile time, before @INC is set up.

Windows needs to do file globbing on @ARGV for t/TEST to work cor-
rectly.  Windows only uses TEST for miniperl (it uses harness for
‘make test’), and under miniperl ‘glob’ doesn’t use File::Glob.  So it
is safe to use ‘glob’ on Windows.  For the sake of other systems, we
can put it in a string eval to avoid even compiling the op.

9 years agoop.c: S_maybe_targlex needs no dVAR
Father Chrysostomos [Wed, 7 Jan 2015 17:44:22 +0000 (09:44 -0800)]
op.c: S_maybe_targlex needs no dVAR

I thought it would be needed for PL_opargs, but PL_opargs is truly
global, even with PERL_GLOBAL_STRUCT.

9 years agoFix broken ext/POSIX/t/wrappers.t on Windows
Karl Williamson [Wed, 7 Jan 2015 17:31:29 +0000 (10:31 -0700)]
Fix broken ext/POSIX/t/wrappers.t on Windows

Windows doesn't have LC_MESSAGES, so skip the code if it isn't defined.

9 years agoRemove obscure "attrib -r ..\t\*.*" command from minitest recipe
Steve Hay [Wed, 7 Jan 2015 14:24:14 +0000 (14:24 +0000)]
Remove obscure "attrib -r ..\t\*.*" command from minitest recipe

This command is not run for any other test targets, and there seems to be
no point in it, at least not now, since files under t\ are not read-only
anyway.

(It dates from the creation of the minitest target in commit 137443ea0a.
At that time, the same command was already used in the $(PERLEXE) target,
having been added there in the initial creation of win32/Makefile in
commit 0a753a7640. Needless to say, neither commit gives any details on
why the command was deemed necessary.)

9 years agoSilence warning during VC++/nmake build
Steve Hay [Wed, 7 Jan 2015 14:08:27 +0000 (14:08 +0000)]
Silence warning during VC++/nmake build

"Use of uninitialized value $opt{"uselongdouble"} in string eq at
config_sh.PL line 202."

Only GCC supports USE_LONG_DOUBLE, so set the option to undef for VC++.

9 years agoFix minitest (op/taint.t) for GCC 4.x
Steve Hay [Wed, 7 Jan 2015 14:02:10 +0000 (14:02 +0000)]
Fix minitest (op/taint.t) for GCC 4.x

9 years agoRemove Windows makefile support for building without PerlIO
Steve Hay [Wed, 7 Jan 2015 13:47:32 +0000 (13:47 +0000)]
Remove Windows makefile support for building without PerlIO

As noted in #123394, building without PerlIO was all but deprecated in
5.18.0 and is no longer supported by Configure on POSIX systems, so there
is no need for the Windows makefiles to provide support for it either.

Therefore, we can simply enable PerlIO in the canned configuration files
and remove any fiddling with that setting for the real configuration,
which means that miniperl will also now have PerlIO enabled without
needing the recently added change to win32.h.

9 years agoPATCH: [perl #123503] Bug in POSIX::strerror on 5.21.7
Karl Williamson [Fri, 26 Dec 2014 21:49:17 +0000 (14:49 -0700)]
PATCH: [perl #123503] Bug in POSIX::strerror on 5.21.7

There were 3 ideas for a patch: mine, Slaven's, and Father
Chrysostomos'.  I tried out all 3, and all three appear to work, without
breaking #123171.  But I chose FC's as I think it is the best.

I had to create a new .t because it turns out that the test didn't fail
when placed in the obvious test file, wrappers.t.  It appears that the
'use File::Temp' in that file perturbs things to not fail later on.
This is scary, so I created a minimal file.  I thought about using
fresh_perl, but wrappers.t needs functions from Test::More.

9 years agoAdd test case for [perl #123171]
Karl Williamson [Wed, 7 Jan 2015 04:05:43 +0000 (21:05 -0700)]
Add test case for [perl #123171]

This looks for a non-English locale to test with, as the bug appears
only in such locales.  The fix to the referenced ticket broke the .t
file in non-English locales, and this commit fixes it.  If no
non-English locale is found, the code runs anyway, using an English one.

Part of the commit came from Slaven Rezic.

9 years agoregcomp.c: Rmv no-longer-used macro and function
Karl Williamson [Mon, 5 Jan 2015 22:32:53 +0000 (15:32 -0700)]
regcomp.c: Rmv no-longer-used macro and function

There are no longer any calls to these, so can be removed.

9 years agoregcomp.c: Don't use general macro
Karl Williamson [Mon, 5 Jan 2015 22:30:42 +0000 (15:30 -0700)]
regcomp.c: Don't use general macro

The macro REGC is used to hide PASS1 behavior versus PASS2 behavior from
the caller.  But this is the last use of REGC, and it's only executed in
PASS2, so it doesn't need the generality (and obscurity) that REGC
provides.

9 years agoregcomp.c: Refactor as a result of [perl #123539]
Karl Williamson [Tue, 6 Jan 2015 20:08:06 +0000 (13:08 -0700)]
regcomp.c: Refactor as a result of [perl #123539]

The previous commit was a minimal patch for this bug, suitable for a
maintenance release.  This patch refactors that fix to eliminate special
cases (hence branches) and makes things more logical and clearer.

The original code shoe-horned two cases together that, it turns out,
should have been handled separately, and this patch does that.

The earlier code was somewhat stilted to conform with the reguni() API.
Now that reguni is no longer called, this gets cleaned up.

9 years agoPATCH: [perl #123539] regcomp.c node overrun/segfault
Karl Williamson [Tue, 6 Jan 2015 20:07:51 +0000 (13:07 -0700)]
PATCH: [perl #123539] regcomp.c node overrun/segfault

This is a minimal patch suitable for a maintenance release.  It extracts
the guts of reguni and REGC without the conditional they have.  The next
commit will do some refactoring to avoid branching and to make things
clearer.

This bug is due to the current two pass structure of the Perl regular
expression compiler.  The first pass attempts to do just enough work to
figure out how much space to malloc for the compiled pattern; and the
2nd pass actually fills in the details.  One problem with this design is
that in many cases quite a bit of work is required to figure out the
size, and this work is thrown away and redone in the second pass.
Another problem is that it is easy to forget to do enough work in the
sizing pass, and that is what happened with the blamed commit.  I
understand that there are plans (God speed) to change the compiler
design.

When not under /i matching, the size of a node that will match a
sequence of characters is just the number of bytes those characters take
up.  We have an easy way to calculate the number of bytes any code point
will occupy in UTF-8, and it's just 1 byte per code point for non-UTF-8.
So in the sizing pass, we don't actually have to figure out the
representation of the characters.  However under /i matching, we do.
First of all, matching of UTF-8 strings is done by replacing each
character of each string by its fold-case (function fc()) and then
comparing.  This is required by the nature of full Unicode matching
which is not 1-1.  If we do that replacement for the pattern at compile
time, we avoid having to do it over-and-over as pattern matching
backtracks at execution.  And because fc(x) may not occupy the same
number of bytes as x, and there is no easy way to know that size without
actually doing the fc(), we have to do the fold in the sizing pass.
Now, there are relatively few folds where sizeof(fc(x)) != sizeof(x), so
we could construct an exception table for those few cases where it is,
and look up through that.

But there is another reason that we have to fold in the sizing pass.
And that is because of the potential for multi-character folds being
split across regnodes.  The regular expression compiler generates
EXACTish regnodes for matching sequences of characters exactly or via
/i.  The limit for how many bytes in a sequence such a node can match is
255 because the length is stored in a U8.  If the pattern has a sequence
longer than that, it is split into two or more EXACTish nodes in a row.
(Actually, the compiler splits at a size much lower than that; I'm not
sure why, but then two adjoining nodes whose total sum length is at most
255 get joined later in the third, optimizing pass.)  Now consider,
matching the character U+FB03 LATIN SMALL LIGATURE FFI.  It matches the
sequence of the three characters "f f i".  Because of the design of the
regex pattern matching code, if these characters are such that the first
one or two are at the end of one EXACTish node, and the final two or one
are in another EXACTish node, then U+FB03 wrongly would not match them.
Matches can't cross node boundaries.  If the pattern were tweaked so all
three characters were in either the first or second node, then the match
would succeed.  And that is what the compiler does.  When it reaches the
node's size limit, and the final character is one that is a non-terminal
character in a multi-char fold, what's in the node is backed-off until
it ends with a character without this characteristic.  This has to be
done in the sizing pass, as we are repacking the nodes, which can affect
the size of the pattern, and we have to know what the folds are in order
to determine all this.

(We don't fold non-UTF-8 patterns.  This is for two reasons.  One is
that one character, the U+00B5 MICRO SIGN, folds to above-Latin1, and if
we folded it, we would have to change the pattern into UTF-8, and that
would slow everything down.  I've thought about adding a regnode type
for the much more common case of a sequence that doesn't have this
character in it, and which could hence be folded at compile time.  But
I've not been able to justify this because of the 2nd reason, which is
folds in this range are simple enough to be handled by an array lookup,
so folding is fast at runtime.)

Then there is the complication of matching under locale rules.  This bug
manifested itself only under /l matching.  We can't fold at pattern
compile time, because the folding rules won't be known until runtime.
This isn't a problem for non-UTF-8 locales, as all folds are 1-1, and so
there never will be a multi-char fold.  But there could be such folds in
a UTF-8 locale, so the regnodes have to be packed to work for that
eventuality.  The blamed commit did not do that, and because this issue
doesn't arise unless there is a string long enough to trigger the
problem, this wasn't found until now.  What is needed, and what this
commit does, is for the unfolded characters to be accumulated in both
passes.  The code that looks for potential multi-char fold issues
handles both folded and unfolded-inputs, so will work.

9 years agominitest needs config.h to build $(MINIPERL)
Steve Hay [Tue, 6 Jan 2015 18:13:26 +0000 (18:13 +0000)]
minitest needs config.h to build $(MINIPERL)

Since f7219c0a9696421192a4830631fa6e3fd28adf39 didn't work out, just add
the config.h dependency directly to minitest instead (which was my main
reason for doing this anyway).

We can also drop the utils dependency from minitest since it doesn't seem
to be required other than to get git_version.h/Config_git.pl made along
the way, but we can add that dependency directly instead. In this way,
minitest still works, but now without building the full perl.exe and
perl5XX.dll as well (which was previously happening as a consequence of
the utils dependency).

9 years agoRevert commit f7219c0a9696421192a4830631fa6e3fd28adf39
Steve Hay [Tue, 6 Jan 2015 16:06:46 +0000 (16:06 +0000)]
Revert commit f7219c0a9696421192a4830631fa6e3fd28adf39

That broke the (full) build. Sorry for only minitest-ing before pushing :-/

9 years agopad.c: Remove unused context params
Father Chrysostomos [Tue, 6 Jan 2015 05:58:53 +0000 (21:58 -0800)]
pad.c: Remove unused context params

9 years agorefactor gv_add_by_type
Daniel Dragan [Sun, 4 Jan 2015 22:49:09 +0000 (17:49 -0500)]
refactor gv_add_by_type

gv_add_by_type was added in commit d5713896ec in 5.11.0 . Improve
gv_add_by_type by making it return the newly created SV*, instead of the
the GV *, which the caller must deref both the GV head to get svu and
then deref a slice into the GP, even though it already derefed svu and GP
right before, to figure out whether to call gv_add_by_type in the first
place. The original version of this patch had gv_add_by_type returning a
SV ** to ensure lvalue-ness but it was discovered it wasn't needed and not
smart.

-rename gv_add_by_type since it was removed from public api and its proto
 changed
-remove null check since it is impossible to pass null through GvAVn(),
 and unlikely with gv_AVadd, null segvs reliably crash in the rare case of
 a problem
-instead of S_gv_init_svtype and gv_add_by_type using a tree of logic/
 conditional jumps in asm, use a lookup table, GPe (e=enum or entry)
 enums are identical to offsets into the GP struct, all of then fit under
 0xFF, if the CC and CPU arch wants, CC can load the const once into a
 register, then use the number for the 2nd deref, then use the number again
 as an arg to gv_add_by_type, the low (&~0xf) or high (<<2) 2 bits in a
 GPe can be used for something else in the future since GPe is pointer
 aligned
-SVt_LAST triggers "panic: sv_upgrade to unknown type", so use that value
 for entries of a GP which are not SV head *s and are invalid to pass as
 an arg
-remove the tree of logic in S_gv_init_svtype, replace with a table
-S_gv_init_svtype is now tail call friendly and very small
-change the GV**n to be rvalues only, assigning to GV**n is probably a
 memory leak
-fix 1 core GV**n as lvalue use
-GvSVn's unusual former definition is from commit 547f15c3f9 in 2005
 and DEFSV as lvalue is gone in core as of commit 414bf5ae08 from 2008
 since all the GV**n macros are now rvalues, this goes too
-PTRPTR2IDX and PTRSIZELOG2 could use better names
-in pp_rv2av dont declare strings like that VC linker won't dedup that, and
 other parts of core also have "an ARRAY", perl521.dll previously had 2
 "an ARRAY" and "a HASH" strings in it due to this

before VC 2003 32 perl521.dll .text 0xc8813 in machine code bytes after
.text 0xc8623

9 years agoperly.y: Don’t call op_lvalue on refgen kid
Father Chrysostomos [Tue, 6 Jan 2015 05:41:26 +0000 (21:41 -0800)]
perly.y: Don’t call op_lvalue on refgen kid

ck_spair also applies lvalue context to the kid ops, so we just end up
calling op_lvalue twice on the same ops.  It’s harmless (being idempo-
tent), but wasteful.

9 years agoRevert "const + static vtables in threads::shared"
Father Chrysostomos [Tue, 6 Jan 2015 05:32:03 +0000 (21:32 -0800)]
Revert "const + static vtables in threads::shared"

This reverts commit 7105b7e7a5e49caa06b8d7ef71008838ec902227.

9 years agominiperl needs config.h to build
Steve Hay [Tue, 6 Jan 2015 13:10:25 +0000 (13:10 +0000)]
miniperl needs config.h to build

9 years agoperlpolicy: add a missing verb
Ricardo Signes [Tue, 6 Jan 2015 12:10:13 +0000 (07:10 -0500)]
perlpolicy: add a missing verb

9 years agoCan't put a comment in the middle of a command broken across lines
Steve Hay [Tue, 6 Jan 2015 09:22:08 +0000 (09:22 +0000)]
Can't put a comment in the middle of a command broken across lines

Actually, you can in the nmake makefile (win32/Makefile), which is surely
how it slipped through in commit 4ea01bd3b4, but you can't do it in the
dmake makefile (win32/makefile.mk). Change it in both for consistency.

9 years agoIncrease perl5db.pl’s $VERSION to 1.47
Father Chrysostomos [Tue, 6 Jan 2015 04:31:46 +0000 (20:31 -0800)]
Increase perl5db.pl’s $VERSION to 1.47

9 years agoUpdate address for E. Choroba
Father Chrysostomos [Tue, 6 Jan 2015 02:07:38 +0000 (18:07 -0800)]
Update address for E. Choroba

9 years agoperl5db.pl: Undefined subroutine &DB::db_warn
E. Choroba [Tue, 6 Jan 2015 02:05:17 +0000 (18:05 -0800)]
perl5db.pl: Undefined subroutine &DB::db_warn

Perl debugger sometimes tries to call a non-existent subroutine
db_warn. It's real name is _db_warn, though.

How to replicate:

perl -d -e1
!/

Output:

/bin/bash: /: Is a directory
Undefined subroutine &DB::db_warn called at /usr/lib/perl5/5.18.1/perl5db.pl line 6740.
  at /usr/lib/perl5/5.18.1/perl5db.pl line 6740.
         DB::_db_system('/bin/bash', '-c', '/') called at /usr/lib/perl5/5.18.1/perl5db.pl line 3923
         DB::Obj::_handle_sh_command('DB::Obj=HASH(0x105df48)') called at /usr/lib/perl5/5.18.1/perl5db.pl line 2992
         DB::DB called at -e line 1

9 years agoMerge branch 'perlpolicy' into blead
Ricardo Signes [Tue, 6 Jan 2015 02:31:49 +0000 (21:31 -0500)]
Merge branch 'perlpolicy' into blead

9 years agoperlpolicy: clarify what "feature can be replaced" means
Ricardo Signes [Fri, 19 Dec 2014 02:25:27 +0000 (21:25 -0500)]
perlpolicy: clarify what "feature can be replaced" means

9 years agoperlpolicy: the point is caution, not low stakes
Ricardo Signes [Fri, 19 Dec 2014 02:21:58 +0000 (21:21 -0500)]
perlpolicy: the point is caution, not low stakes

9 years agoforward reference from "new features" to "experimental"
Ricardo Signes [Wed, 17 Dec 2014 00:33:00 +0000 (19:33 -0500)]
forward reference from "new features" to "experimental"

9 years agoproposed changes for perlpolicy updates
Ricardo Signes [Wed, 17 Dec 2014 00:32:47 +0000 (19:32 -0500)]
proposed changes for perlpolicy updates

see http://nntp.perl.org/group/perl.perl5.porters/219866

9 years agoTest-Simple Version Bump, 1.301001_097 (RC17)
Chad Granum [Mon, 5 Jan 2015 16:30:00 +0000 (08:30 -0800)]
Test-Simple Version Bump, 1.301001_097 (RC17)

9 years agoconst + static vtables in threads::shared
Daniel Dragan [Mon, 5 Jan 2015 06:44:59 +0000 (01:44 -0500)]
const + static vtables in threads::shared

This makes threads::shared have no non-NULL initialized RW static data.
Uninitialized and NULL filled RW data like PL_sharedsv_space and
prev_signal_hook remain, but on some OSes/CCs (Win32 with special tweaks),
this means that now the RW data section in threads::shared shared library
has no disk representation. Static the remaining RW vars to trim the
symbol table on non-Win32.

9 years agoconst a PERLIO vtable in PerlIO::encoding
Daniel Dragan [Mon, 5 Jan 2015 06:27:11 +0000 (01:27 -0500)]
const a PERLIO vtable in PerlIO::encoding

This makes PerlIO::encoding's shared library free of any perl caused RW
static data.

9 years agomake minitest (mostly) work on Win32
Tony Cook [Tue, 6 Jan 2015 00:24:53 +0000 (11:24 +1100)]
make minitest (mostly) work on Win32

The only test left failing is op/glob.t, since I couldn't find the
cause of the failure

9 years agominitest: run the sames tests on win32 as on POSIXish systems
Tony Cook [Tue, 9 Dec 2014 04:13:04 +0000 (15:13 +1100)]
minitest: run the sames tests on win32 as on POSIXish systems

9 years agominitest: miniperl on win32 always displays the x86 arch, so skip testing it
Tony Cook [Tue, 9 Dec 2014 04:06:05 +0000 (15:06 +1100)]
minitest: miniperl on win32 always displays the x86 arch, so skip testing it

9 years agominitest op/magic.t: skip the env_is() tests on Win32 miniperl
Tony Cook [Tue, 9 Dec 2014 03:38:38 +0000 (14:38 +1100)]
minitest op/magic.t: skip the env_is() tests on Win32 miniperl

Since 1070c8d6 env_is() requires the Win32 module on Win32, which
miniperl can't load

9 years agoWin32 minitest: -k is never available on Win32
Tony Cook [Mon, 8 Dec 2014 04:11:29 +0000 (15:11 +1100)]
Win32 minitest: -k is never available on Win32

Given the structure of the tests and the code, I can only assume
S_ISVTX is only unavailable on Win32 out of the systems we run
minitest on.

9 years agominiperl on Win32 doesn't have fork()
Tony Cook [Mon, 8 Dec 2014 02:27:35 +0000 (13:27 +1100)]
miniperl on Win32 doesn't have fork()

9 years agosome socket functions aren't available under Win32 miniperl
Tony Cook [Mon, 8 Dec 2014 01:56:07 +0000 (12:56 +1100)]
some socket functions aren't available under Win32 miniperl

This only skips for bind, connect, accept() and select().

Other functions are tested in coreamp.t, but either aren't called with
valid handles, so don't reach the "unimplemented" errors, or don't
trigger the errors for other reasons.

fixes: op/coreamp.t, op/sselect.t, op/tie_fetch_count.t

9 years agodisable Win32 sloppy stat in io/fs.t, io/stat.t
Tony Cook [Mon, 8 Dec 2014 00:44:52 +0000 (11:44 +1100)]
disable Win32 sloppy stat in io/fs.t, io/stat.t

8ce7a7e8b08f added a line to write_buildcustomize.pl to enable
${^WIN32_SLOPPY_STAT} in lib/buildcustomize.pl on Win32.

This meant the nlink value from stat wasn't being populated correctly
causing the link count tests to fail

9 years agouse textmode when opening scripts in miniperl to match perl
Tony Cook [Tue, 16 Dec 2014 06:05:18 +0000 (17:05 +1100)]
use textmode when opening scripts in miniperl to match perl

fixes io/data.t

This could be considered a bug in io/data.t, since it writes the scripts
in text mode, but making miniperl behave closer to perl may fix
other issues too.

9 years agobuild miniperl with PerlIO
Tony Cook [Tue, 16 Dec 2014 06:04:09 +0000 (17:04 +1100)]
build miniperl with PerlIO

Several tests use PerlIO layers (:utf8, :pop) without testing for it.

non-PerlIO builds were vaguely deprecated in 5.18.0 and can no longer be
enabled on POSIX systems through Configure, so making miniperl PerlIO
on Win32 is no big stretch

minitests failing now:

io/data.t
io/fs.t
op/coreamp.t
op/filetest.t
op/fork.t
op/glob.t
op/heredoc.t
op/magic.t
op/sselect.t
op/stat.t
op/tie_fetch_count.t

9 years agot/TEST: glob the supplied filenames on Win32
Tony Cook [Mon, 8 Dec 2014 00:01:34 +0000 (11:01 +1100)]
t/TEST: glob the supplied filenames on Win32

since Win32 perl doesn't glob by default

at this point the following tests fail:

io/dup.t
io/fs.t
io/open.t
io/perlio_leaks.t
op/coreamp.t
op/filetest.t
op/fork.t
op/fresh_perl_utf8.t
op/glob.t
op/heredoc.t
op/magic.t
op/read.t
op/readline.t
op/sselect.t
op/stat.t
op/substr.t
op/tie_fetch_count.t
op/write.t