This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perl5.git
9 years agothreads.pm version bump for 0c87ebb8.
Jarkko Hietaniemi [Sat, 6 Dec 2014 20:58:01 +0000 (15:58 -0500)]
threads.pm version bump for 0c87ebb8.

9 years agoFollowup 3f39ca90: those functions need no prototypes for ext/re.
Jarkko Hietaniemi [Sat, 6 Dec 2014 20:27:41 +0000 (15:27 -0500)]
Followup 3f39ca90: those functions need no prototypes for ext/re.

9 years agog++ groks __attribute__((unused)) at least since 4.3.6.
Jarkko Hietaniemi [Sat, 6 Dec 2014 15:14:30 +0000 (10:14 -0500)]
g++ groks __attribute__((unused)) at least since 4.3.6.

Cannot find the exact moment from gcc release notes, but tests fine in 4.3.6.
(not fine = "warning: unused ...")

9 years agoIf no lchown, not using the args.
Jarkko Hietaniemi [Sat, 6 Dec 2014 14:21:34 +0000 (09:21 -0500)]
If no lchown, not using the args.

9 years agoVariables possibly clobbered by longjmp/vfork.
Jarkko Hietaniemi [Sat, 6 Dec 2014 14:04:49 +0000 (09:04 -0500)]
Variables possibly clobbered by longjmp/vfork.

(my_perl in the line 480 has the same problem, but messier to fix.)

9 years agoThese functions are not used with ext/re.
Jarkko Hietaniemi [Sat, 6 Dec 2014 13:42:11 +0000 (08:42 -0500)]
These functions are not used with ext/re.

9 years agoB::Deparse: Escape non-ASCII printable chars
Father Chrysostomos [Sat, 6 Dec 2014 14:15:40 +0000 (06:15 -0800)]
B::Deparse: Escape non-ASCII printable chars

Before this, we were escaping all non-ASCII chars if the string con-
tained any non-printable chars.  So ".\x{100}" would come out exactly
like that, but "\x{100}" would be deparsed as "Ā", causing problems if
the script has no ‘use utf8’ in scope.

(It was also misbehaving on EBCDIC, causing the existing \x
test to fail.)

9 years agoDeparse.pm: Don’t call maybe_parens for sv_undef
Father Chrysostomos [Sat, 6 Dec 2014 14:01:03 +0000 (06:01 -0800)]
Deparse.pm: Don’t call maybe_parens for sv_undef

(LIST)[INDEX] is neat, but it doesn’t short-circuit, so it should not
be used if LIST contains method calls.

9 years agoRemove comp/opsubs.t from deparse-skips.txt
Father Chrysostomos [Sat, 6 Dec 2014 06:44:56 +0000 (22:44 -0800)]
Remove comp/opsubs.t from deparse-skips.txt

It passes.  Since when I don’t know.

9 years agoRemove comp/hints.t from deparse-skips.txt
Father Chrysostomos [Sat, 6 Dec 2014 06:43:40 +0000 (22:43 -0800)]
Remove comp/hints.t from deparse-skips.txt

It passes, probably due to BEGIN block fixes.

9 years agodeparse-skips.txt: Note some skip reasons
Father Chrysostomos [Sat, 6 Dec 2014 06:41:49 +0000 (22:41 -0800)]
deparse-skips.txt: Note some skip reasons

9 years agoRemove comp/form_scope.t from deparse-skips.txt
Father Chrysostomos [Sat, 6 Dec 2014 06:40:15 +0000 (22:40 -0800)]
Remove comp/form_scope.t from deparse-skips.txt

It passes!

9 years agoDeparse formats in the right spot
Father Chrysostomos [Sat, 6 Dec 2014 05:41:30 +0000 (21:41 -0800)]
Deparse formats in the right spot

Formats need the same logic applied in 34b54951568, to avoid this:

Input:

{
    my $x;
    format STDOUT =
@
$x
.
}
__END__

$ pbpaste|./perl -Ilib -MO=Deparse
{
    my $x;
}
format STDOUT =
@
$x
.
__DATA__
- syntax OK

That $x in the format is now global, not lexical.

Also, we need to make sure the sequence numbers are correct.  The
statement after the format stopped having a higher sequence number
than CvOUTSIDE_SEQ(format) in 8635e3c238f, because the ‘pending’
sequence number set aside for the nextstate op created just after com-
pile-time block exit (which nextstate op comes before the block) was
not actually being used by newFORM (unlike newATTRSUB), so the follow-
ing statement was using that number.

9 years agoAvoid extraneous ‘();’ when deparsing just subs
Father Chrysostomos [Sat, 6 Dec 2014 05:45:10 +0000 (21:45 -0800)]
Avoid extraneous ‘();’ when deparsing just subs

34b54951 caused a program that is empty apart from sub definitions to
be deparsed with ‘();’ for the main sub.  Previously it was omitted.
This commit removes it, not only for the sake of backward-compatibil-
ity, but also because ‘();’ is not a particularly sane way of dumping
an empty program.

9 years agoop.c: use GV_NOTQUAL in newATTRSUB_x
Father Chrysostomos [Sat, 6 Dec 2014 06:06:58 +0000 (22:06 -0800)]
op.c: use GV_NOTQUAL in newATTRSUB_x

If we are scanning for the package separator ourselves, then we can
notify gv_fetchsv that we found none, so it doesn’t have to scan
again.

9 years ago1 exit path for returning ptr in Perl_safesysmalloc and Perl_safesysrealloc
Daniel Dragan [Wed, 3 Dec 2014 09:59:46 +0000 (04:59 -0500)]
1 exit path for returning ptr in Perl_safesysmalloc and Perl_safesysrealloc

commit 6edcbed640 goto-ed around an initialization and was partially
reverted in commit c62df97fd6 . This patch restores the intention of
commit 6edcbed640 by having only 1 exit path that will be returning
a pointer (and not croaking).

9 years agoIncrease $NDBM_File::VERSION to 1.14
Father Chrysostomos [Sat, 6 Dec 2014 04:40:22 +0000 (20:40 -0800)]
Increase $NDBM_File::VERSION to 1.14

9 years agoIncrease $mro::VERSION to 1.17
Father Chrysostomos [Sat, 6 Dec 2014 04:39:52 +0000 (20:39 -0800)]
Increase $mro::VERSION to 1.17

9 years agoIncrease $Data::Dumper::VERSION to 2.155
Father Chrysostomos [Sat, 6 Dec 2014 04:39:29 +0000 (20:39 -0800)]
Increase $Data::Dumper::VERSION to 2.155

9 years agodont test for bootstrap file twice in XSLoader
Daniel Dragan [Sat, 6 Dec 2014 01:23:06 +0000 (20:23 -0500)]
dont test for bootstrap file twice in XSLoader

This saves ~8ms on my mech HD Win64 system per load() call.
See [perl #123373] for details.

9 years agocleanup logic in S_sv_uncow
Daniel Dragan [Fri, 5 Dec 2014 22:34:32 +0000 (17:34 -0500)]
cleanup logic in S_sv_uncow

I couldnt understand this code at first glance. Many empty conditional
blocks because of page protection ROing which isn't implemented on Win32,
caused erratic stepping in my debugger with CC optimizations *off*.

-read COWREFCNT only once
-save COWREFCNT to an auto for debugger visual inspection
-don't check len twice
-don't write sv_buf_to_rw() twice

No change in behavior is expected.

9 years agoRevert "toke.c: Remove redundant PL_expect check"
Father Chrysostomos [Sat, 6 Dec 2014 01:55:17 +0000 (17:55 -0800)]
Revert "toke.c: Remove redundant PL_expect check"

This reverts commit 8b4c5ad11955dc809ba3b7d6672b3a13ea54e770.

It caused bug #123372.

9 years agoTest bug #123372
Father Chrysostomos [Sat, 6 Dec 2014 01:55:08 +0000 (17:55 -0800)]
Test bug #123372

9 years agoInitialize possibly uninitialized.
Jarkko Hietaniemi [Sat, 6 Dec 2014 02:59:28 +0000 (21:59 -0500)]
Initialize possibly uninitialized.

9 years agoUnused expression + variable.
Jarkko Hietaniemi [Sat, 6 Dec 2014 01:16:54 +0000 (20:16 -0500)]
Unused expression + variable.

9 years agoSome versions of gcc -Wextra are too paranoid about { 0 }.
Jarkko Hietaniemi [Sat, 6 Dec 2014 01:14:20 +0000 (20:14 -0500)]
Some versions of gcc -Wextra are too paranoid about { 0 }.

9 years agoPOSIX math potentially unused vars.
Jarkko Hietaniemi [Sat, 6 Dec 2014 01:04:08 +0000 (20:04 -0500)]
POSIX math potentially unused vars.

9 years agogcc thinks it can see how 'entry' can be accessed uninitialized.
Jarkko Hietaniemi [Fri, 5 Dec 2014 03:08:28 +0000 (22:08 -0500)]
gcc thinks it can see how 'entry' can be accessed uninitialized.

9 years agoPOSIX nan: declaring s always potentially unused.
Jarkko Hietaniemi [Fri, 5 Dec 2014 02:58:56 +0000 (21:58 -0500)]
POSIX nan: declaring s always potentially unused.

9 years agoUnused hv_store() result.
Jarkko Hietaniemi [Fri, 5 Dec 2014 02:41:11 +0000 (21:41 -0500)]
Unused hv_store() result.

9 years agoUnused var.
Jarkko Hietaniemi [Fri, 5 Dec 2014 02:40:19 +0000 (21:40 -0500)]
Unused var.

9 years agoprintf type-matching continues. again.
Jarkko Hietaniemi [Fri, 5 Dec 2014 02:23:59 +0000 (21:23 -0500)]
printf type-matching continues. again.

9 years agoDeparse PVMG stubs
Father Chrysostomos [Fri, 5 Dec 2014 22:46:53 +0000 (14:46 -0800)]
Deparse PVMG stubs

Creating a weak reference to a stash entry will cause it to be of type
PVMG, if it was not a GV already.  B::Deparse was trying to determine,
based on the internal SV type, whether it had a sub stub.  It should
be checking flags instead, otherwise valid stubs get omitted.

9 years agoDeparse predeclared prototyped subs
Father Chrysostomos [Fri, 5 Dec 2014 14:21:35 +0000 (06:21 -0800)]
Deparse predeclared prototyped subs

A predeclared sub without a prototype works fine:

$ ./perl -Ilib -MO=Deparse -e 'sub f; sub f{}; foo()'
sub f {

}
foo();
-e syntax OK

A prototyped sub with no predeclaration is fine:

$ ./perl -Ilib -MO=Deparse -e ' sub f($){}; foo()'
sub f ($) {

}
foo();
-e syntax OK

A prototyped stub is fine:

$ ./perl -Ilib -MO=Deparse -e 'sub f($);  foo()'
sub f ($);
foo();
-e syntax OK

Only a predeclared prototyped sub seems to have trouble appear-
ing properly:

$ ./perl -Ilib -MO=Deparse -e 'sub f($); sub f($){}; foo()'
sub f;
foo();
-e syntax OK

The code that searches the stashes (stash_subs) was assuming that any-
thing of type B::PV was a prototype.  In this case, the stash entry
started as a string and then got ‘downgraded’ to a reference, so
internally it is of type PV (which can hold a ref), which B represents
as B::PV, so the assumption that a PV is a prototyped stub is wrong.

9 years agoRevert "Remove branch seemingly untaken"
Steffen Mueller [Fri, 5 Dec 2014 19:43:08 +0000 (20:43 +0100)]
Revert "Remove branch seemingly untaken"

This reverts commit 9349a6bbb9de151e5385038b962ceff7c7278b53.

It is taken. Sigh. I'm sorry.

9 years agoRemove branch seemingly untaken
Steffen Mueller [Fri, 5 Dec 2014 16:23:55 +0000 (17:23 +0100)]
Remove branch seemingly untaken

An HV* that is not an SVt_PVHV? Maybe I don't have sufficient fantasy.
This branch goes back to 1994, so things have changed ... a bit since
then.

9 years agoRestore profile dump under PERL_DESTRUCT_LEVEL
Father Chrysostomos [Fri, 5 Dec 2014 06:41:02 +0000 (22:41 -0800)]
Restore profile dump under PERL_DESTRUCT_LEVEL

$ ./perl -Ilib -DP -e0
filter_add func 1000dfa20 ()
filter_read 0: via function 7f8fd302fe88 ()
filter_read 0: via function 7f8fd302fe88 ()
filter_del func 1000dfa20
EXECUTING...

    1 nextstate
    1 enter
    1 leave
$ PERL_DESTRUCT_LEVEL=2 ./perl -Ilib -DP -e0
filter_add func 107b81a20 ()
filter_read 0: via function 7f81e882fea0 ()
filter_read 0: via function 7f81e882fea0 ()
filter_del func 107b81a20
EXECUTING...

The list of ops executed is omitted if I set PERL_DESTRUCT_LEVEL=2.
This was probably broken by bf9cdc68d2.

9 years agoCorrect dependencies for charclass_invlists.h
Father Chrysostomos [Fri, 5 Dec 2014 01:28:19 +0000 (17:28 -0800)]
Correct dependencies for charclass_invlists.h

regen.t should fail if Unicode tables are updated and this header is
not regenerated.

See commit 713f4b7fa and the thread beginning at
<20141204124705.472.qmail@lists-nntp.develooper.com>.

9 years agoop.c:fold_constants: Remove OP_RV2GV/newGVOP
Father Chrysostomos [Fri, 5 Dec 2014 00:13:19 +0000 (16:13 -0800)]
op.c:fold_constants: Remove OP_RV2GV/newGVOP

OP_RV2GV is not foldable, so it never reaches this code, which
goes back to 79072805 (perl 5.0 alpha 2).  Even back then it was
unreachable.

9 years agoop.c:fold_constants: Simplify OP_STRINGIFY logic
Father Chrysostomos [Fri, 5 Dec 2014 00:11:02 +0000 (16:11 -0800)]
op.c:fold_constants: Simplify OP_STRINGIFY logic

Don’t put the same condition in two places.  We are already using a bool-
ean.  We can put the result of the condition in it.

9 years agoReturn fresh scalar from join(const,const)
Father Chrysostomos [Fri, 5 Dec 2014 00:07:45 +0000 (16:07 -0800)]
Return fresh scalar from join(const,const)

$ perl5.20.1 -Ilib  -le 'for(1,2) { push @_, \join "x", 1 } print for @_'
SCALAR(0x7fb131005438)
SCALAR(0x7fb131005648)
$ ./perl -Ilib  -le 'for(1,2) { push @_, \join "x", 1 } print for @_'
SCALAR(0x7fe612831b30)
SCALAR(0x7fe612831b30)

Notice how we now get two references to the same scalar.  I broke this
accidentally in 987c9691.  If join has two arguments, it gets con-
verted to a stringify op.  The stringify op might get constant-folded,
and folding of stringify is special, because the parser uses it
itself to implement qq().  So I had ck_join set op_folded to flag
the op as being a folded join.  Only that came too late, because
op_convert_list(OP_STRINGIFY,...) folds the op before it returns it.
Hence, the folded constant was flagged the wrong way, and stopped
being implicitly copied by refgen (\).

9 years agoLocale-Maketext 1.26 is now on CPAN
Chris 'BinGOs' Williams [Fri, 5 Dec 2014 00:05:50 +0000 (00:05 +0000)]
Locale-Maketext 1.26 is now on CPAN

9 years agoSyncing back Changelog to be consistent with CPAN release
Todd Rinaldo [Thu, 4 Dec 2014 23:54:22 +0000 (18:54 -0500)]
Syncing back Changelog to be consistent with CPAN release

Whitespace corrections; update perldelta.

For: RT #121671

9 years agoUpdate Encode to CPAN version 2.67
Chris 'BinGOs' Williams [Thu, 4 Dec 2014 22:59:24 +0000 (22:59 +0000)]
Update Encode to CPAN version 2.67

  [DELTA]

$Revision: 2.67 $ $Date: 2014/12/04 20:13:00 $
! t/taint.t
  Now skips nonexistent methods like Encode::Detect->encode() should
  that be installed.  This resolves RT#100105.
  https://rt.cpan.org/Ticket/Display.html?id=100105

9 years agoDon’t deparse formats with #line directives
Father Chrysostomos [Thu, 4 Dec 2014 20:32:55 +0000 (12:32 -0800)]
Don’t deparse formats with #line directives

$ perl5.20.1 -mO=Deparse,-l -e 'format =' -e\@ -e'$foo' -e.
format STDOUT =
@
$foo
.
-e syntax OK
$ ./perl -Ilib -mO=Deparse,-l -e 'format =' -e\@ -e'$foo' -e.
format STDOUT =
@

#line 3 "-e"
; $foo
.
-e syntax OK

The second is not valid syntax.

I probably broke that when fixing BEGIN blocks.

9 years agodump.c: Don’t dump CvOUTSIDE SV when there is none
Father Chrysostomos [Thu, 4 Dec 2014 19:16:27 +0000 (11:16 -0800)]
dump.c: Don’t dump CvOUTSIDE SV when there is none

$ ./perl -Ilib -MDevel::Peek -Mfeature=:all -Xle 'my sub f; Dump \&f'
SV = IV(0x7fd7138312b0) at 0x7fd7138312c0
  REFCNT = 1
  FLAGS = (TEMP,ROK)
  RV = 0x7fd713831b90
  SV = PVCV(0x7fd7138303d0) at 0x7fd713831b90
    REFCNT = 2
    FLAGS = (CLONED,DYNFILE,NAMED,LEXICAL)
    COMP_STASH = 0x7fd713807ce8 "main"
    ROOT = 0x0
    NAME = "f"
    FILE = "-e"
    DEPTH = 0
    FLAGS = 0x19040
    OUTSIDE_SEQ = 187
    PADLIST = 0x7fd7134067e8
    PADNAME = 0x7fd713411f88(0x7fd713406d48) PAD = 0x7fd713807e68(0x7fd71340d2f8)
    OUTSIDE = 0x0 (null)
    SV = 0

That final ‘SV = 0’ is very confusing!

9 years ago[perl #123357] Fix deparsing of $; at stmt end
Father Chrysostomos [Thu, 4 Dec 2014 16:39:28 +0000 (08:39 -0800)]
[perl #123357] Fix deparsing of $; at stmt end

Instead of sometimes appending ; to statements and then removing it
later, to avoid doubling it up, *only* append ; to a statement when
actually joining them together or emitting them.  That fixes bugs with
do{$;} becoming do {$} and ‘$_=$;; $;=7;’ becoming ‘$_=$; $;=7;’.

I also removed the boilerplate from pp_stub, since it was redundant
(and slow) and also partially wrong.  The $name var was bogus.

9 years agoDeparse.pm: Remove temp pre-PADNAME code
Father Chrysostomos [Thu, 4 Dec 2014 13:45:01 +0000 (05:45 -0800)]
Deparse.pm: Remove temp pre-PADNAME code

added in d4f1bfe749f, which got merged before the PADNAME changes.

9 years agoDeparse.pm: Remove special \0 marker
Father Chrysostomos [Thu, 4 Dec 2014 13:43:23 +0000 (05:43 -0800)]
Deparse.pm: Remove special \0 marker

In 4b1385ee6 I did not realise we already had \cK, which served almost
the same purpose.

9 years agoUnescape directory portion of path in unixify.
Craig A. Berry [Thu, 4 Dec 2014 14:02:09 +0000 (08:02 -0600)]
Unescape directory portion of path in unixify.

Basically I missed a spot in 812e68ff314e, so the escaped space
in [foo^_bar], for example, was not translated correctly.

9 years agoAdd checksum to regcharclass.h
Father Chrysostomos [Thu, 4 Dec 2014 06:41:45 +0000 (22:41 -0800)]
Add checksum to regcharclass.h

and check that checksum in t/porting/regen.t.  This makes the tests
run faster.

9 years agoAdd checksum to charclass_invlists.h
Father Chrysostomos [Thu, 4 Dec 2014 06:37:22 +0000 (22:37 -0800)]
Add checksum to charclass_invlists.h

and check that checksum in t/porting/regen.t.  This makes the tests
run faster.

9 years agoDeparse $x =~ (1?/$a/:0) under taint mode
Father Chrysostomos [Thu, 4 Dec 2014 06:07:39 +0000 (22:07 -0800)]
Deparse $x =~ (1?/$a/:0) under taint mode

This code deparses incorrectly under taint mode:

$ ./perl -Ilib -mO=Deparse  -e '$x =~ (1?/$a/:0)'
$x =~ ($_ =~ /$a/);
-e syntax OK
$ ./perl -Ilib -mO=Deparse -T -e '$x =~ (1?/$a/:0)'
$x =~ /$a/;
-e syntax OK

The branch folding makes it deparse as ‘$x =~ /$a/’, whereas the /$a/
on the rhs, since it was not the argument to =~, is bound to $_, not
to $x.  That’s why B::Deparse adds the $_ =~, but it fails to do so
under taint mode.

It was broken by:

commit 7fb31b92fa6bf56dff7d4240b7051b9158f7df43
Author: David Mitchell <davem@iabyn.com>
Date:   Sun Apr 1 10:21:22 2012 +0100

    make OP_REGCRESET only for taint handling

    The OP_REGCRESET op, which is sometimes prepended to the chain of ops
    leading to OP_REGCOMP, currently serves two purposes; first to reset the
    taint flag, and second to initialise PL_reginterp_cnt. The second purpose
    is no longer needed, and the first has a bug, in that the op isn't
    prepended when "use re 'eval'" is in scope.

    Fix this by prepending the op solely when PL_tainting is in effect.
    This also makes run-time regexes slightly more efficient in the
    non-tainting case.

which has a typo in it.

9 years agoperlfork.pod: convert "\t"s to spaces.
Shlomi Fish [Thu, 16 Oct 2014 09:25:30 +0000 (12:25 +0300)]
perlfork.pod: convert "\t"s to spaces.

For: RT #122987 (second part)

9 years agoRemove trailing whitespace.
Shlomi Fish [Thu, 16 Oct 2014 09:20:22 +0000 (12:20 +0300)]
Remove trailing whitespace.

For: RT #122987 (first part)

9 years agoConvert "\t"s to spaces in perlref.pod.
Shlomi Fish [Thu, 16 Oct 2014 08:43:06 +0000 (11:43 +0300)]
Convert "\t"s to spaces in perlref.pod.

For: RT #122986

9 years agoperldata: document corrected list slicing behaviour
Aristotle Pagaltzis [Thu, 10 Oct 2013 05:24:10 +0000 (07:24 +0200)]
perldata: document corrected list slicing behaviour

9 years ago[perl #114498] lslice returning empty vs undef
Father Chrysostomos [Wed, 3 Dec 2014 21:55:03 +0000 (13:55 -0800)]
[perl #114498] lslice returning empty vs undef

Formerly, list slice would return an empty list if all the indices
fell outside the actual list, but would return ‘undef’ for every index
specified if but one of them fell within the list.

This was not implemented according to the original design, according
to which list slice would give an empty list (for a non-zero number of
indices) only if the list on the left-hand side were empty.

This commit rectifies that.  See ticket #114498 for the discussion.

9 years ago[Merge] Deparse regexp code blocks
Father Chrysostomos [Thu, 4 Dec 2014 01:45:31 +0000 (17:45 -0800)]
[Merge] Deparse regexp code blocks

The actual ops that make up the code blocks are now deparsed.
B::Deparse no longer uses the stringified form stored in the regexp.
This fixes a few bugs.  See the individual commits for details.

9 years agoDeparse s/// with code blocks
Father Chrysostomos [Wed, 3 Dec 2014 20:52:13 +0000 (12:52 -0800)]
Deparse s/// with code blocks

Before, s/$a(?{die})// would deparse like this:

s/${a}do {
    die
}(?{die})//;

Now it deparses correctly.

9 years agoDeparse.pm: Fold some logic into sub code_list
Father Chrysostomos [Wed, 3 Dec 2014 06:25:59 +0000 (22:25 -0800)]
Deparse.pm: Fold some logic into sub code_list

Both callers were doing $op->first->sibling, so just have code_list
do that itself.

9 years agoDeparse qr// and m// with code blocks and vars
Father Chrysostomos [Wed, 3 Dec 2014 06:22:25 +0000 (22:22 -0800)]
Deparse qr// and m// with code blocks and vars

Before, this:

/$a(?{ die $b; })/;
qr/$a(?{ die $b; })/;

would deparse as this:

/${a}do {
    die $b
}(?{ die $b; })/;
qr/sub : lvalue {
    $a, do {
        die $b
    }, '(?{ die $b; })'
}
->()/;

Now it deparses correctly.

9 years agoDeparse regexp code blocks in m// and split //
Father Chrysostomos [Wed, 3 Dec 2014 02:10:35 +0000 (18:10 -0800)]
Deparse regexp code blocks in m// and split //

The blocks themselves are now deparsed, rather than the original strings
being emitted.  This fixes problems with newlines turning into \n and
here-docs missing their bodies.  It only applies to compile-time patterns.
Run-time patterns (with variables interpolated outside the code blocks)
are still unfixed and deparse with do{...} embedded in the pattern.

9 years agoDeparse.t: Put a line break after the test code
Father Chrysostomos [Tue, 2 Dec 2014 22:53:32 +0000 (14:53 -0800)]
Deparse.t: Put a line break after the test code

The line break gets removed when it is extracted from the __DATA__
section, and then it gets wrapped in sub{$input}.  That breaks
here-docs.

9 years agoDeparse qr/(?{code_blocks})/ with no interpolation
Father Chrysostomos [Tue, 2 Dec 2014 17:33:38 +0000 (09:33 -0800)]
Deparse qr/(?{code_blocks})/ with no interpolation

This is a preliminary patch that only applies when there are no varia-
bles interpolated into the pattern outside of the code blocks.

The code blocks are now actually deparsed, instead of the stringified
form just being reproduced.  This means the \n bug is gone:

Before:

$  ./perl -Ilib -mO=Deparse -e '{ qr/aaaaa\\\\\\(?{;' -e '$y})' -e '/}'
{
    qr/aaaaa\\\\\\(?{;\n\$y})\n/;
}
-e syntax OK

After:

$ ./perl -Ilib -mO=Deparse -e '{ qr/aaaaa\\\\\\(?{;' -e '$y})' -e '/}'
{
    qr/aaaaa\\\\\\(?{ $y; })\n/;
}
-e syntax OK

You can see the \n translation now happens only outside of the block.

It also means here-docs work:

Before:

$  ./perl -Ilib -mO=Deparse -e 'qr/(??{<<END})/' -efoo -eEND
qr/(??{<<END})/;
-e syntax OK

(The output is a syntax error.)

After:

$ ./perl -Ilib -mO=Deparse -e 'qr/(??{<<END})/' -efoo -eEND
qr/(??{ "foo\n"; })/;
-e syntax OK

9 years agoDeparse FOO =~ y///r correctly
Father Chrysostomos [Tue, 2 Dec 2014 14:06:05 +0000 (06:06 -0800)]
Deparse FOO =~ y///r correctly

Apparently anything =~ y///r with the /r never deparsed properly (just
the lhs deparsed) until 05a502dc, when lexicals on the lhs started
being emitted.

9 years agoTo-do tests for deparsing regexp code blocks
Father Chrysostomos [Tue, 2 Dec 2014 06:32:41 +0000 (22:32 -0800)]
To-do tests for deparsing regexp code blocks

Currently we have various bugs:
• Line breaks often come out as \n, changing the meaning.
• Some blocks are doubled up with do{...} for the first instance.
• qr/sub { .... }/ madness

9 years agoFix deparsing of $lexical =~ //
Father Chrysostomos [Tue, 2 Dec 2014 13:57:40 +0000 (05:57 -0800)]
Fix deparsing of $lexical =~ //

I broke this in 05a502dc.

9 years agoDeparse: matchop: Remove double method+function call
Father Chrysostomos [Tue, 2 Dec 2014 13:51:36 +0000 (05:51 -0800)]
Deparse: matchop: Remove double method+function call

9 years agoperldelta for the prev. commit
Father Chrysostomos [Wed, 3 Dec 2014 20:37:24 +0000 (12:37 -0800)]
perldelta for the prev. commit

based on https://rt.perl.org/Ticket/Display.html?id=40565#txn-1321149

9 years ago[perl #40565] Fix localisation in pseudo-fork
Father Chrysostomos [Wed, 3 Dec 2014 18:30:06 +0000 (10:30 -0800)]
[perl #40565] Fix localisation in pseudo-fork

Several SAVEt_* types were giving the SVs the wrong reference counts
in ss_dup, causing child process to lose SVs too soon.

See <https://rt.perl.org/Ticket/Display.html?id=40565#txn-1180404>
and <https://rt.perl.org/Ticket/Display.html?id=40565#txn-1277127>.

9 years agodump.c: Clarify pod
Karl Williamson [Wed, 26 Nov 2014 21:01:43 +0000 (14:01 -0700)]
dump.c: Clarify pod

9 years agoperly.c: Fix off-by-1 error for EBCDIC platforms
Karl Williamson [Sun, 30 Nov 2014 05:40:34 +0000 (22:40 -0700)]
perly.c: Fix off-by-1 error for EBCDIC platforms

Code point 255 was being omitted in the translation.  It's better to use
the macro (that has it correctly) and avoid a redundant copy of the
test.

9 years agospecial-case Pod::Checker ABSTRACT
David Mitchell [Wed, 3 Dec 2014 16:55:46 +0000 (16:55 +0000)]
special-case Pod::Checker ABSTRACT

Currently the auto-generated Makefile.PL for Pod::Checker raises a
warning with MakeMaker, since the abstract in the pod isn't parseable.

Also, the package's own Makefile.PL doesn't work with blead (I didn't
exactly understand what the issue was, but porting/dual_lift.t complained
about missing utilities).

So the most expedient hack is to special-case the ABSTRACT in make_ext.pl.

9 years agoreinstate cpan/IO-Compress/Makefile.PL
David Mitchell [Wed, 3 Dec 2014 15:49:15 +0000 (15:49 +0000)]
reinstate cpan/IO-Compress/Makefile.PL

This was removed a year ago, but it causes problems with
ABSTACT and ABSTACT_FROM; since there isn't an IO/Compress.pm
file. make_ext.pl special-cases Makefile.PL to get the abstract
from IO/Compress/Base.pm; but MakeMaker looks for, and fails to
find, 'IO::Compress - ...' in the pod for that file,and prints an error.

Rather than more special-casing, it's easier to just restore the
distribution's Makefile.PL, which already contains the correct
'ABSTRACT => ...' entry.

9 years agoUpdate IO-Socket-IP to CPAN version 0.34
Chris 'BinGOs' Williams [Wed, 3 Dec 2014 13:46:27 +0000 (13:46 +0000)]
Update IO-Socket-IP to CPAN version 0.34

  [DELTA]

0.34    2014/12/03 00:04:56
        [BUGFIXES]
         * Don't select() for read-readiness when waiting for non-blocking
           connect() because it upsets VMS (RT100654)

9 years agoUpdate Encode to CPAN version 2.66
Chris 'BinGOs' Williams [Wed, 3 Dec 2014 13:44:45 +0000 (13:44 +0000)]
Update Encode to CPAN version 2.66

  [DELTA]

$Revision: 2.66 $ $Date: 2014/12/02 23:30:34 $
! bin/enc2xs
  Resolved RT#100656: enc2xs -C fails if URL::Encode::XS is installed
  https://rt.cpan.org/Ticket/Display.html?id=100656

9 years agoEliminate eliminate_macros and fixpath.
Craig A. Berry [Wed, 3 Dec 2014 04:09:12 +0000 (22:09 -0600)]
Eliminate eliminate_macros and fixpath.

These functions have been deprecated outside of MakeMaker for
many years, but due to the complicated inheritance situation
in EUMM have been difficult to get rid of because sometimes the
File::Spec versions would get called when we thought we were
calling the MakeMaker versions.  As of MakeMaker 7.04, the last
call to the File::Spec version of fixpath is gone, so we can
finally remove these from File::Spec.

And bump PathTools versions once again.

9 years agoreduce stderr noise in build
David Mitchell [Wed, 3 Dec 2014 13:30:12 +0000 (13:30 +0000)]
reduce stderr noise in build

Ideally you should be able to do

    (Configure && make test) 2> /tmp/err

with /tmp/err being empty. This is not the case, and this commit
is a first step towards that goal.

The

    fprintf (stderr, "Sizeof time_t = %ld\n", sizeof (time_t));

in Configure appears to be just a debugging aid; it's also a copy of the
code in Porting/timecheck.c, which people can always run if need-be.

hints/linux.sh appears to be looking for symbols in libdb.so; if the
library is stripped, this produces to stderr:

    /bin/nm: /lib/libdb.so: no symbols

I've silenced it for now with a 2>/dev/null, but I'm not sure if the whole
test is flawed, since with no symbols, 'nm libdb.so | grep pthread' is a
no-op.

make_patchnum.pl, when running backticks, prints $? to stderr if it's
non-zero; since a similar print in the other branch is already commented
out, I assume its just left-over debugging.

9 years agoStop test suite filling /tmp
David Mitchell [Wed, 3 Dec 2014 10:53:00 +0000 (10:53 +0000)]
Stop test suite filling /tmp

Some test files use File::Temp in such a way that the temporary files and
directories under /tmp aren't deleted at the end. On a smoker system, this
can gradually accumulate thousands of entries under /tmp.

The general culprits fixed by this commit are:

1) using tempfile() without the UNLINK => 1 argument;

2) Using Test::More (which uses Test::Stream), which creates a test
   directory in such a way that only the original parent thread will
   remove it; for some reason I still don't fully understand, detaching a
   thread rather than joining it stops this clean up happening. In the
   affected test files, I replaced the ->detach() with a ->join() just
   before exit, and the problem went away.

Some tests under cpan/ are still leaky; these will be addressed upstream.

9 years agopp_eof: a new SV can't have setmagic
Daniel Dragan [Wed, 3 Dec 2014 00:31:35 +0000 (19:31 -0500)]
pp_eof: a new SV can't have setmagic

-dont compute GvSV multiple times

9 years agoperldelta for faa5d6ec871c
Tony Cook [Wed, 3 Dec 2014 03:02:28 +0000 (14:02 +1100)]
perldelta for faa5d6ec871c

9 years ago[perl #122635] avoid turning a leading // into / on cygwin
Tony Cook [Wed, 3 Dec 2014 02:51:59 +0000 (13:51 +1100)]
[perl #122635] avoid turning a leading // into / on cygwin

//server/sharename is used for Win32 shares on cygwin

bump version, synchronizing across all of PathTools.

9 years agoSpeed up method calls like $o->Other::method() and $o->Other::SUPER::method().
syber [Mon, 1 Dec 2014 20:20:27 +0000 (23:20 +0300)]
Speed up method calls like $o->Other::method() and $o->Other::SUPER::method().

It was done by adding new OP_METHOD_REDIR and OP_METHOD_REDIR_SUPER optypes.
Class name to redirect is saved into METHOP as a shared hash string.
Method name is changed (class name removed) an saved into op_meth_sv as
a shared string hash.

So there is no need now to scan for '::' and calculate class and method names
at runtime (in gv_fetchmethod_*) and searching cache HV without precomputed hash.

B::* modules are changed to support new op types.
method_redir is now printed by Concise like (for threaded perl)
$obj->AAA::meth
5        <.> method_redir[PACKAGE "AAA", PV "meth"] ->6

9 years ago[perl #123063] allow assert() to be used as an expression
Tony Cook [Wed, 12 Nov 2014 02:53:48 +0000 (13:53 +1100)]
[perl #123063] allow assert() to be used as an expression

In non-DEBUGGING builds it would be replaced with nothing, producing
a syntax error

9 years agoTARG slots have no name, and produced undefined value warnings
Tony Cook [Tue, 2 Dec 2014 23:32:20 +0000 (10:32 +1100)]
TARG slots have no name, and produced undefined value warnings

9 years agoAdd James Raspass to AUTHORS
Father Chrysostomos [Tue, 2 Dec 2014 22:10:58 +0000 (14:10 -0800)]
Add James Raspass to AUTHORS

9 years agoIncrease $strict::VERSION to 1.09
Father Chrysostomos [Tue, 2 Dec 2014 22:10:27 +0000 (14:10 -0800)]
Increase $strict::VERSION to 1.09

9 years agoOptimise strict.pm for the common case
James Raspass [Tue, 2 Dec 2014 21:41:19 +0000 (13:41 -0800)]
Optimise strict.pm for the common case

9 years agopad.h: Use PERL_PADNAME_MINIMAL by default
Father Chrysostomos [Tue, 2 Dec 2014 13:48:33 +0000 (05:48 -0800)]
pad.h: Use PERL_PADNAME_MINIMAL by default

See
<CACmk_tvkTETxz2eFc-bJfXEhWRjAexuvv4zw4Z036OJHpWfXVA@mail.gmail.com>
and <20141202004047.10267.qmail@lists-nntp.develooper.com>.

9 years agoperl5220delta: Want 0.24 has been released
Father Chrysostomos [Tue, 2 Dec 2014 13:35:08 +0000 (05:35 -0800)]
perl5220delta: Want 0.24 has been released

9 years agoAdd B::PMOP::pmregexp
Father Chrysostomos [Tue, 2 Dec 2014 06:26:33 +0000 (22:26 -0800)]
Add B::PMOP::pmregexp

There was no way to get from a PMOP to its regexp object under non-
threaded builds.  The threaded pmoffset field was exposed, but not its
non-threaded counterpart.

I implemented pmregexp in terms of PM_GETRE (which uses op_pmoffset
with threads and op_pmregexp without), so it works under threads, too.
It’s easier than conditionally using the regex_padav to get at things
like this:

$ ./perl -Ilib -MB -e 'use O "Concise", B::regex_padav->ARRAYelt(B::svref_2object(sub {qr/(??{})/})->ROOT->first->first->sibling->pmoffset)->qr_anoncv->object_2svref'
B::Concise::compile(CODE(0x7f8e9185ba08))
2  <1> leavesub[1 ref] K/REFC,1 ->(end)
1     </> qr() P/RTIME ->2
-        <@> list K ->-
-           <0> pushmark s ->-
-           <1> null sK*/1 ->-
-              <1> ex-scope sK ->(end)
-                 <0> stub s ->(end)
-           <$> const(PV "(\077?{})") s ->-
-e syntax OK

With pmregexp, it is ‘only’:

$ ./perl -Ilib -MB -e 'use O "Concise", B::svref_2object(sub {qr/(??{})/})->ROOT->first->first->sibling->pmregexp->qr_anoncv->object_2svref'

9 years agob.t: Move a test
Father Chrysostomos [Tue, 2 Dec 2014 06:08:49 +0000 (22:08 -0800)]
b.t: Move a test

This should go with the other regexp tests.

9 years agoUpdate ExtUtils-MakeMaker to CPAN version 7.04
Chris 'BinGOs' Williams [Tue, 2 Dec 2014 14:21:54 +0000 (14:21 +0000)]
Update ExtUtils-MakeMaker to CPAN version 7.04

  [DELTA]

7.04 Tue Dec  2 12:43:48 GMT 2014

    No changes from 7.03_06

7.03_06 Mon Dec  1 15:35:28 GMT 2014
    Doc fixes:
    - Corrected MAGICXS documentation

7.03_05 Fri Nov 28 18:27:09 GMT 2014
    Doc fixes:
    - Remove Module::Build encouragement

7.03_04 Thu Nov 27 14:35:15 GMT 2014
    Core fixes:
    - Do not use ccstdflags with the core extensions

7.03_03 Tue Nov 25 16:37:57 GMT 2014
    Win32 Fixes:
    - Eliminate sub-process spawning when checking make type

7.03_02 Mon Nov 24 13:18:09 GMT 2014
    VMS fixes:
    - Fix a couple of missing vendor targets
    - Remove VAXCCURSE from ExtUtils::Liblist::Kid::_vms_ext.

7.03_01 Tue Nov 18 21:29:40 GMT 2014
    VMS fixes:
    - Handle spaces in install targets
    - Allow spaces in eliminate_macros and fixpath
    - Remove fixpath call from ExtUtils::Liblist::Kid::_vms_ext.
    - Override is_make_type() as checks as unnecessary

    Core fixes:
    - Wrap parse_abstract() call to Encode in eval() to
      avoid build failures
    - Fix issue with CCFLAGS in core

9 years agoUpgrade Devel::PPPort from 3.24 to 3.25
Matthew Horsfall (alh) [Tue, 2 Dec 2014 13:18:32 +0000 (08:18 -0500)]
Upgrade Devel::PPPort from 3.24 to 3.25

9 years agoperlfunc: document immediate stricture effect of "our"
Aristotle Pagaltzis [Tue, 2 Dec 2014 03:05:20 +0000 (04:05 +0100)]
perlfunc: document immediate stricture effect of "our"

9 years agoShow elapsed wallclock time in t/TEST.
Jarkko Hietaniemi [Sat, 29 Nov 2014 17:54:59 +0000 (12:54 -0500)]
Show elapsed wallclock time in t/TEST.

9 years agobench.pl: Load IO::File explicitly
Father Chrysostomos [Tue, 2 Dec 2014 00:32:06 +0000 (16:32 -0800)]
bench.pl: Load IO::File explicitly

to work with older perls that don’t load it automatically.

$ Porting/bench.pl perl5.8.8 perl5.8.7
Can't locate object method "blocking" via package "IO::File" at Porting/bench.pl line 737.

(In this case the system perl is 5.12.4.)

9 years agobench.pl: Correct optional = in pod synopsis
Father Chrysostomos [Tue, 2 Dec 2014 00:29:22 +0000 (16:29 -0800)]
bench.pl: Correct optional = in pod synopsis

9 years agofix g++ builds: conversions from void * need a cast
Tony Cook [Mon, 1 Dec 2014 23:28:08 +0000 (10:28 +1100)]
fix g++ builds: conversions from void * need a cast