platform/upstream/perl.git
10 years agomktables: Stop generating most leading zeros
Karl Williamson [Mon, 28 Oct 2013 22:43:01 +0000 (16:43 -0600)]
mktables: Stop generating most leading zeros

Leading zeros were generated to conform with Unicode usage, but these
are machine-read files so this just takes up some extra space and extra
parsing cycles at run-time.  It's a small matter, but we should design
our files to be the most efficient possible.  It is possible to get more
human-readable files by using the -annotate option to mktables.

Certain files whose existence has been published have their formats
unchanged, in case some application is reading them.  The files contain
comments that their use is deprecated, but there is no warning generated
if they are opened and read, nor is it really feasible to add such a
warning.  At some time in the future, we may feel it's ok to remove
these files, as their contents have been available since v5.16 through a
stable API in Unicode::UCD, but until we remove them, we shouldn't
change their formats.

Not all other leading zeros are removed; just the ones that were
convenient to remove.

10 years agomktables: Further explain how things work in a comment
Karl Williamson [Sun, 20 Oct 2013 16:57:21 +0000 (10:57 -0600)]
mktables: Further explain how things work in a comment

10 years agomktables: Add an advisory comment to generated files.
Karl Williamson [Sun, 20 Oct 2013 16:27:42 +0000 (10:27 -0600)]
mktables: Add an advisory comment to generated files.

10 years agomktables: Regenerate if called with different cmd line args
Karl Williamson [Sun, 20 Oct 2013 16:20:13 +0000 (10:20 -0600)]
mktables: Regenerate if called with different cmd line args

mktables acts pretty much like its own Makefile.  This is because the
rules for regenerating are complicated and too hard to keep in sync in a
Makefile with new versions of Unicode.  mktables itself already has
enough intelligence to automatically update the rules when it gets
modified to account for new files from Unicode.

However, prior to this commit, it didn't keep track of the options it
was called with, thus it wouldn't necessarily run when those options
changed to affect the desired outputs.

10 years agomktables: Tighten regex match to real data
Karl Williamson [Sun, 20 Oct 2013 16:13:39 +0000 (10:13 -0600)]
mktables: Tighten regex match to real data

The actual file has spaces, so use \s instead of the more dangerous dot.
Also, after processing the line, no need to look to see if it matches
something else.

10 years agomktables: Fixup debugging info
Karl Williamson [Fri, 18 Oct 2013 02:05:18 +0000 (20:05 -0600)]
mktables: Fixup debugging info

The -annotate parameter generates extra information in the tables
created by mktables which is useful to me in understanding the Unicode
standard and debugging.  I doubt that anyone else has ever used it.  It
has been broken for some tables for some time.  This commit fixes those.

10 years agomktables: Always strip off returned comments in tables
Karl Williamson [Mon, 30 Dec 2013 22:43:12 +0000 (15:43 -0700)]
mktables: Always strip off returned comments in tables

mktables generates (among other things) many perl .pl files which when
executed, return a string containing many lines.  Each line may end
with '#' comments.  Previously, it didn't always strip off those
comments to the caller, which it assumed uses a 'do' statement to
execute these, and the comments are automatically ignored.  However, it
turns out that the 'mkheader' script in Unicode::Normalize doesn't cope
with these comments.  This usually doesn't get called except once when
normally these comments aren't generated, but if it does, things don't
just compile.  So, just strip off the comments, rather than letting the
'do' handle it.

10 years agomktables: White-space only: wrap to 79 cols
Karl Williamson [Fri, 18 Oct 2013 02:03:52 +0000 (20:03 -0600)]
mktables: White-space only: wrap to 79 cols

10 years agoregcomp.c: Add comments
Karl Williamson [Tue, 31 Dec 2013 15:06:17 +0000 (08:06 -0700)]
regcomp.c: Add comments

10 years agoregcomp.c: Reinstate use of synthetic start class
Karl Williamson [Sun, 29 Dec 2013 04:48:57 +0000 (21:48 -0700)]
regcomp.c: Reinstate use of synthetic start class

This effectively reverts commit
a74bca75951b6a3b0ad03ba07eb31e2ca1227308, although the syntax has
changed.  This commit inadvertently caused a synthetic start class (SSC)
to not be generated in many cases where it previously was.  The
SSC is generated by the regex optimizer to hopefully speed up finding
where to start matching the target string against the regex pattern.  I
don't know if this is a valid data point, but in the 3 months that this
was in blead, there were no complaints of a slowdown that could be
attributed to this.

The commit that caused this was made after discussing it with Yves
Orton.  It just seemed (and still seems) wrong that doing what the code
indicates is a logical OR should actually restrict the possibilities.
The change essentially caused the result of OR'ing together the matches
of two nodes, one of which nominally could match a sub-string of zero
length, to also match a sub-string of zero length.  Previous to that
commit, and after this new one, the result of doing the OR excludes a
zero-length string, as if it were an AND.

The end result of the change was that the SSC could match a zero-length
string, and thus was discarded as not being useful.  Yves and I knew
that the change would not cause bugs; just potentially create more false
positives.  And we were right.

I believe that this is further indication that the optimizer could
benefit greatly from an overhaul.  It's clear from looking at the code
and commits that other people have been similarly fooled.

10 years agotoke.c: Remove redundant check
Father Chrysostomos [Tue, 31 Dec 2013 05:18:54 +0000 (21:18 -0800)]
toke.c: Remove redundant check

(and turn it into an assertion.)

PL_lex_repl can only be set here if we are parsing a substitution
(OP_SUBST) or transliteration (OP_TRANS).  I believe this check
has been unnecessary since perl 5.000, which it was added.

10 years agoImprove rcatline bad fh warnings
Father Chrysostomos [Mon, 30 Dec 2013 01:11:24 +0000 (17:11 -0800)]
Improve rcatline bad fh warnings

This is not helpful:

append I/O operator() on closed filehandle STDIN at - line 3.
append I/O operator() on closed filehandle STDIN at - line 4.
(Are you trying to call append I/O operator() on dirhandle STDIN?)

That .=<> compiles to a separate op from <> is an implementation
detail, so show ‘readline()’ as we do with <>.

10 years agoperlhacktips: -Accflags for PERL_DEBUG_READONLY_OPS
Father Chrysostomos [Mon, 30 Dec 2013 00:43:03 +0000 (16:43 -0800)]
perlhacktips: -Accflags for PERL_DEBUG_READONLY_OPS

It is not clear to all that this has to be specified as
-Accflags=-D... when used on the Configure command line.

10 years agoperlguts: Make Memory Allocation and PerlIO top-level
Father Chrysostomos [Sun, 29 Dec 2013 01:34:38 +0000 (17:34 -0800)]
perlguts: Make Memory Allocation and PerlIO top-level

These two sections were in the middle of the subroutines section,
but they have little to do with subroutines, whereas the surrounding
sections do pertain to them.  I think it was a mistake for them to
have been put under Subroutines to begin with.

10 years agoConsistent spaces after dots in perlintern.pod
Father Chrysostomos [Sun, 29 Dec 2013 01:28:09 +0000 (17:28 -0800)]
Consistent spaces after dots in perlintern.pod

10 years agoperlapi: Consistent spaces after dots
Father Chrysostomos [Sat, 28 Dec 2013 14:55:13 +0000 (06:55 -0800)]
perlapi: Consistent spaces after dots

plus some typo fixes.  I probably changed some things in perlintern, too.

10 years agocut out/inline wrapper calls of sv_*catpvf*
Daniel Dragan [Thu, 26 Dec 2013 19:18:16 +0000 (14:18 -0500)]
cut out/inline wrapper calls of sv_*catpvf*

these wrappers use 1 or 2 indirect calls to reach the guts of Perl's
format string engine. Win64 and ARM (and I assume other 4 register regcall
platforms) compilers can't easily tailcall or optimize these due to
sv_vcatpvfn_flags > 4 args and strlen calls. They allocate lots of C
stack and set up new frames and copy args over. So just call the core
format string function directly.

Not all paths to sv_vcatpvfn_flags were optimized since they have no CORE
or CPAN grep usage. sv_vcatpvf has usage, sv_catpvf_mg* have none but were
done anyway because they sound like they would be commonly used.

10 years agoAdd names (descriptions) to t/dumper.t tests lacking them.
James E Keenan [Tue, 24 Dec 2013 02:43:16 +0000 (03:43 +0100)]
Add names (descriptions) to t/dumper.t tests lacking them.

TEST() runs over its first argument three times.  The description is only
printed on the first of the three tests.  Suggestions for more precise
descriptions welcome.

For: RT #120854

10 years agoFix $Config{src} on VMS.
Craig A. Berry [Sat, 28 Dec 2013 20:09:46 +0000 (14:09 -0600)]
Fix $Config{src} on VMS.

It may not matter much as it's been broken since dab31494e8bab and
doesn't seem to have caused any trouble, but to be pedantically
correct the location of the source is not the same as the install
location.

10 years agoMake perl_setup.com infer perl_root from its own location.
Craig A. Berry [Sat, 28 Dec 2013 17:22:28 +0000 (11:22 -0600)]
Make perl_setup.com infer perl_root from its own location.

The perl_setup.com command procedure initializes the root logical
name, the shareable image logical name pointing to the main Perl
dynamic library, and either command symbols or command table
entries that reference those logical names.  It's always by
default hard-coded the prefix chosen at configuration time as the
basis for where Perl should be located.

The original rationale for that was that it gets run right before
installperl and sets things up correctly for installation.  But
that optimizes for a single use case that is easily handled by
specifying the correct install location as a parameter and
pessimizes for every other use case, notably relocating an
installed Perl directory tree.

So make it infer the correct root from its own location and
specify the install location only at installation time.  Among
other benefits, this allows the install location to be chosen
at installation time by overriding the default prefix like so:

  MMK/MACRO=(PREFIX="DSA0:[homedir.MyPerl2.]") install

10 years agoMerge the sfio removal to blead.
Nicholas Clark [Fri, 27 Dec 2013 15:22:45 +0000 (16:22 +0100)]
Merge the sfio removal to blead.

10 years agoAdd the removal of the sfio support to perldelta.
Nicholas Clark [Fri, 27 Dec 2013 15:20:08 +0000 (16:20 +0100)]
Add the removal of the sfio support to perldelta.

Given that this code no longer works, it doesn't feel important to list it in
the headlines. It's not clear where the best section for it is.

10 years agoPurge sfio support from configure.com, Configure and related files.
Nicholas Clark [Tue, 10 Dec 2013 18:32:59 +0000 (19:32 +0100)]
Purge sfio support from configure.com, Configure and related files.

Most of these are actually generated, so the maintenance complexity reduction
is not as impressive as the diffstat suggests.

(Incorporating a fix from Merijn)

10 years agoPurge sfio support, which has been broken for a decade.
Nicholas Clark [Mon, 9 Dec 2013 21:18:22 +0000 (22:18 +0100)]
Purge sfio support, which has been broken for a decade.

The last Perl release that built with -Dusesfio was v5.8.0, and even that
failed many regression tests. Every subsequent release fails to build, and
in the decade that has passed we have had no bug reports about this. So it's
safe to delete all the code. The Configure related code will be purged in a
subsequent commit.

2 references to sfio intentionally remain in fakesdio.h and nostdio.h, as
these appear to be for using its stdio API-compatibility layer.

10 years agoFix sfio breakage caused by the fix for RT #78494.
Nicholas Clark [Mon, 9 Dec 2013 08:15:10 +0000 (09:15 +0100)]
Fix sfio breakage caused by the fix for RT #78494.

Commit 2e0cfa16dea85dd3 (Feb 2011) fixed RT #78494, but inadvertently broke
non-PerlIO configurations. -Uuseperlio was restored in March 2011 with commit
b6ae43b72863e12d, but this change is needed to restore the sfio build.

This is the last fix needed to get blead building with -Dusesfio, after 10
years of breakage. However, many many tests still fail (and one hangs).
Note, specifically this is only tested with sfio97. Perl is making a couple
of cheating assumptions which break with sfio2005, and I've not attempted to
fix Perl's naughtiness to get it to build with current sfio. (Nor has anyone
else in the past 8 years, it would seem. Or even reported a problem.)

10 years agoFix a typo introduced in Nov 2008 by commit 4ee3916907333148.
Nicholas Clark [Sun, 8 Dec 2013 20:50:53 +0000 (21:50 +0100)]
Fix a typo introduced in Nov 2008 by commit 4ee3916907333148.

One use of dSAVE_ERRNO was mistyped as dSAVED_ERRNO, but as it was in the
sfio-only code it was not spotted.

10 years agoFix sfio breakage caused by the addition of PERLIO_TERM in Oct 2006.
Nicholas Clark [Sun, 8 Dec 2013 20:11:46 +0000 (21:11 +0100)]
Fix sfio breakage caused by the addition of PERLIO_TERM in Oct 2006.

Commit 6cb8cb214e85c7d6 in Oct 2006 added a new macro PERLIO_TERM, but didn't
provide an appropriate definition for the sfio build. Commit 6b29934bd65555b7
(also Oct 2006) plus this change provides a working PERLIO_TERM for sfio.

10 years agoFix sfio breakage in PerlIO_findFILE() caused by commit de009b76d60bdeb8.
Nicholas Clark [Sun, 8 Dec 2013 18:15:25 +0000 (19:15 +0100)]
Fix sfio breakage in PerlIO_findFILE() caused by commit de009b76d60bdeb8.

One hunk of commit de009b76d60bdeb8 (April 2005) makes a variable const,
which is then assigned to. This is in sfio-specific code, so was not noticed.
This change was merged to maint-5.8 as part of commit f1c3982b668c9e30 (Sep
2005).

10 years agoAlso build PerlIO_get_layers with -Dusesfio
Nicholas Clark [Sun, 8 Dec 2013 17:47:54 +0000 (18:47 +0100)]
Also build PerlIO_get_layers with -Dusesfio

This extends patch 5fef3b4a7f0c97d3 from April 2003 from fixing the
stdio-only build to also fix the sfio build, which was broken when
PerlIO_get_layers was added (2 commits previously, 39f7a87036eb8d13).
Without this fix, perl would refuse to build with -Dusesfio.

Given that 39f7a87036eb8d13 was merged to maint-5.8, this means that the
-Dusesfio build was broken for v5.8.1 and later on that branch, as well as
for v5.10.0 and all subsequent releases. Given that in the past 10 years,
no-one has reported this, it's safe to assume that no-one considers sfio
support to be important.

10 years agolib/diagnostics.t: Add test
Karl Williamson [Fri, 27 Dec 2013 04:43:07 +0000 (21:43 -0700)]
lib/diagnostics.t: Add test

This adds a test so that both =item lines of an adjacent pair get
tested.

10 years agolib/diagnostics.t: Use different test data
Karl Williamson [Fri, 27 Dec 2013 04:50:28 +0000 (21:50 -0700)]
lib/diagnostics.t: Use different test data

This is testing that things work for two adjacent =item lines in
perldiag.pod that share the same description.  However a future commit
will change perldiag.pod so that one of the specific adjacent lines
previously used here will be removed.  Therefore, choose a different set
of adjacent lines that aren't scheduled to be changed.

This adds a comment in perldiag that the newly chosen adjacent lines are
thus used in diagnostics.t

10 years agoIncrease $constant::VERSION to 1.31
Father Chrysostomos [Thu, 26 Dec 2013 02:03:16 +0000 (18:03 -0800)]
Increase $constant::VERSION to 1.31

10 years agoRemove constant.pm-specific behaviour from Internals::SvREADONLY
Father Chrysostomos [Thu, 26 Dec 2013 02:02:57 +0000 (18:02 -0800)]
Remove constant.pm-specific behaviour from Internals::SvREADONLY

Some stuff on CPAN is using this undocumented function, so give
constant.pm its own.  It is already a core module, depending on
functionality provided by the core solely for its sake; so this
does not really change its relationship to the core.

10 years agoRevert "[perl #119801] Stop @DB::dbline modifications from crashing"
Father Chrysostomos [Wed, 25 Dec 2013 14:16:31 +0000 (06:16 -0800)]
Revert "[perl #119801] Stop @DB::dbline modifications from crashing"

This reverts commit c1cec775e9019cc8ae244d4db239a7ea5c0b343e.

See ticket #120864.

10 years ago[perl #120426] atof() small value rounding errors
David Mitchell [Mon, 2 Dec 2013 15:04:49 +0000 (15:04 +0000)]
[perl #120426] atof() small value rounding errors

For something like 0.153e-305, which is small, but not quite the smallest
number (which is around 2.2e-308), adding extra digits to the fractional part
could cause unnecessary rounding to zero.

From the bug report:

    $ echo 0.1530e-305 | perl -e '$v = <STDIN>; print "v=", $v + 0, "\n";'
    v=0
    $ echo 0.153e-305  | perl -e '$v = <STDIN>; print "v=", $v + 0, "\n";'
    v=1.53e-306

This was because 0.1234e-305 is calculated as

    1234 / (10^309)

and 10^309 becomes infinity. In these edge cases, repeatedly decrement
the exponent and divide the mantissa by 10 until the exponent becomes in
range; in this case we instead calculate

    123 / (10^308)

10 years agodo cflags on stdout, not stderr
David Mitchell [Wed, 4 Dec 2013 15:53:51 +0000 (15:53 +0000)]
do cflags on stdout, not stderr

The current UNIX build system does a strange thing to generate the
appropriate command-line to compile a particular src file. It calls
the cflags shell script, which
1) echoes to stdout the command line needed to compile the specified
   file (excluding the name of the src file itself), e.g.
        cc -c -Dfoo -Wbar ...
2) echoes the same thing to stderr, prefixied with '   CCCMD ='

Make then does

    `sh cflags foo.o`  foo.c

the cflags output to stdout is captured by the backticks, and is used
by make as the command line to run (with the foo.c appended). This run is
silent. The output to stderr isn't captured, and gets displayed. So the
user sees:

    $ make
    `sh cflags foo.o` foo.c
       CCCMD = cc -c -Dfoo -Wbar ...
    ...

This is annoying for 2 reasons:
1) you don't get a simple command-line displayed which you could do a
simple cut and paste with (e.g. when you want to recompile a specific
source file, but alter the flags).
2) The make generates output on stderr, even when then there aren't any
errors. So "make 2>errs" can't be used to quickly spot warnings and
errors.

This commit fixes this by making cflags just output the cc command and
flags to stdout, then get Makefile to call it twice, once to echo
the command-line (on stdout), and once to execute it with backticks.
So the make output is now:

    $ make
    cc -c -Dfoo -Wbar ... foo.c
    ...

There is some stuff in Makefile.SH related to cross-compiling, which this
commit make have broken. Specifically the CCCMD and CCCMDSRC macros
have been changed in the normal case to remove backticks (and add them to
the make rules instead), but not for the cross compilation route.
The CC* defs in the cross-compilation case have a trailing -I$(CROSS_LIB)
outside of the backticks, which compilates matters.

However, in the subdir Cross/, there appears to be separate (and
divergent) copies of Makefile.SH and cflags, so maybe the files
I edited are no longer used for cross-compilation????

(followup: according to
   <20131204170112.GA2490@iabyn.com>
the cross-compiling stuff I mentioned above has bit-rotted, and I don't
need to worry about it)

10 years agocflags/cflags.SH: use '#' comments
David Mitchell [Tue, 3 Dec 2013 17:12:17 +0000 (17:12 +0000)]
cflags/cflags.SH: use '#' comments

These scripts had a mixture of old-style ':' comments and new-style
'#' comments. Since they have both, the old ones can't be needed for
portability reasons, so standardise on the modern form.

The old-style were just too confusing, especially as my syntax highlighter
didn't know about them.

10 years agocflags.SH - add commentary
David Mitchell [Tue, 3 Dec 2013 16:17:56 +0000 (16:17 +0000)]
cflags.SH - add commentary

Add comments to the top of cflags.SH to explain what it does.
Also make it output comments at the top of the generated cflags
script explaining that its auto-generated.

10 years agodoio.c: Stop semop from modifying its argument
Father Chrysostomos [Wed, 25 Dec 2013 13:44:23 +0000 (05:44 -0800)]
doio.c: Stop semop from modifying its argument

Perl_do_semop, which implements the Perl semop function, copies its
second argument to a new struct array, which it passes to the system’s
semop function.  It then copies the contents of the struct back into
the argument’s string buffer.

Neither the Darwin nor Linux documentation says that semop modifies
the structs passed to it, and, even if it did happen, perl has never
handle it correctly.  It would have to stringify its argument forcibly
(to avoid copying back into a temporary string buffer) and also call
get-magic.  And then it would fail with a read-only argument.

Since read-only arguments have always been permitted and the copy
ing-back has never worked correctly, and since this will cause prob-
lems if we upgrade modifications to COW buffers into crashes (the
PERL_DEBUG_READONLY_COW mode I am working in), this commit removes
that code.

10 years agopp_sys.c remove null checks and locality
Daniel Dragan [Tue, 24 Dec 2013 10:04:55 +0000 (05:04 -0500)]
pp_sys.c remove null checks and locality

pp_enterwrite, EXTEND contains a funccall, dont save gv around it
pp_ioctl, move optype to first place used to reduce liveness

10 years agopp_sys.c: More null check removal
Father Chrysostomos [Tue, 24 Dec 2013 13:44:01 +0000 (05:44 -0800)]
pp_sys.c: More null check removal

Thanks again to Daniel Dragan for pointing out candidates in
<rt-4.0.18-29603-1387872667-551.120842-15-0@perl.org> (ticket #120842).

10 years agoInterpret do CORE() as do-file
Father Chrysostomos [Tue, 24 Dec 2013 06:48:10 +0000 (22:48 -0800)]
Interpret do CORE() as do-file

a96df64385 inadvertently changed it.  do-file is how it has alwas been
interpreted, at least as far back as 5.000, as far as I can tell.

10 years agoLet's be consistent.
Abigail [Tue, 24 Dec 2013 12:51:32 +0000 (13:51 +0100)]
Let's be consistent.

All the sections are of the form '=head2 version - title', except the
one for v5.19.0, which used two dashes.

But no longer.

10 years agoop.c: newLOOPOP: Remove code supporting do-sub
Father Chrysostomos [Tue, 24 Dec 2013 06:11:16 +0000 (22:11 -0800)]
op.c: newLOOPOP: Remove code supporting do-sub

10 years agopp_sys.c: Remove redundant null checks
Father Chrysostomos [Tue, 24 Dec 2013 06:08:26 +0000 (22:08 -0800)]
pp_sys.c: Remove redundant null checks

Nulls only get pushed on to the stack when pp_coreargs uses them to
represent missing optional arguments.  Ops that take * prototypes
will have had their arguments passed through rv2gv first, so they
should always be GVs.  GvIOn never returns null.  When given a GV
argument, it creates a new IO entry and returns that.  When given
any other argument it croaks.

Thank you to Daniel Dragan for providing a list of candidate pp
functions in <rt-4.0.18-29609-1387862001-129.120842-15-0@perl.org>
(ticket #120842).

10 years agopod/perlunicode: White-space only
Karl Williamson [Mon, 23 Dec 2013 18:34:45 +0000 (11:34 -0700)]
pod/perlunicode: White-space only

Commit 1850f57f068545c630b2fb3aa138bbf0fb406e56 placed this verbatim
text heading starting in the wrong column

10 years agopp_sys.c: Remove null checks from pp_sockpair
Father Chrysostomos [Tue, 24 Dec 2013 04:37:18 +0000 (20:37 -0800)]
pp_sys.c: Remove null checks from pp_sockpair

There is actually no way for nulls to reach this code.

Nulls on the stack only happen with pp_coreargs, and only with
ops that have optional arguments, of which socketpair is not one.

GvIOn uses gv_add_by_type, which adds a new IO if there is not
already one, so it will never return null if the GV is not null.

10 years agoRearrange dump.c to organize docs. Add some perlapi docs for debug methods.
Matthew Horsfall [Sun, 17 Nov 2013 21:25:57 +0000 (16:25 -0500)]
Rearrange dump.c to organize docs. Add some perlapi docs for debug methods.

10 years agoperldelta: Silence podchecker
Father Chrysostomos [Mon, 23 Dec 2013 14:02:23 +0000 (06:02 -0800)]
perldelta: Silence podchecker

10 years agopp.c: Remove redundant diag_listed_as
Father Chrysostomos [Mon, 23 Dec 2013 13:57:49 +0000 (05:57 -0800)]
pp.c: Remove redundant diag_listed_as

10 years agotest various types of SVs with call_sv
Daniel Dragan [Sun, 22 Dec 2013 05:54:14 +0000 (00:54 -0500)]
test various types of SVs with call_sv

call_sv takes RVs, PVs, CVs, GVs, and an immortal. This isn't well
documented. CVs and immortals can't, or can't easily be tested from
pure perl, so do it from XS. SVt_PVLV with isGV_with_GP is one thing
call_sv takes but is not tested by this commit. Part of [perl #120826] .

10 years agorefactor pp_socket, pp_socketpair, pp_bind
Daniel Dragan [Sun, 22 Dec 2013 06:39:09 +0000 (01:39 -0500)]
refactor pp_socket, pp_socketpair, pp_bind

pp_socket: remove unreachable made by commit 9c9f25b8ce

pp_socketpair: increase locality, now gv2/io2 is tested before gv1 is
    processed, *v1 vars become non-const to avoid large WS changes in
    opening new scope

pp_bind: move op_type's init so it isn't saved by CC across a func call

10 years ago[perl #115736] fix undocumented param from newATTRSUB_flags
Daniel Dragan [Mon, 23 Dec 2013 07:11:29 +0000 (02:11 -0500)]
[perl #115736] fix undocumented param from newATTRSUB_flags

flags param was poorly designed and didn't have a formal api. Replace it
with the bool it really is. See #115736 for details.

10 years agoRemove support for "do SUBROUTINE(LIST)"
Dagfinn Ilmari Mannsåker [Thu, 27 Jun 2013 15:48:36 +0000 (16:48 +0100)]
Remove support for "do SUBROUTINE(LIST)"

It's been deprecated (and emitting a warning) since Perl v5.0.0, and
support for it consitutes nearly 3% of the grammar.

10 years agoUpdate Encode to CPAN version 2.56
Chris 'BinGOs' Williams [Sun, 22 Dec 2013 14:40:52 +0000 (14:40 +0000)]
Update Encode to CPAN version 2.56

  [DELTA]

$Revision: 2.55 $ $Date: 2013/09/14 07:51:59 $
! Encode.pm t/Encode.t
  Merged RT#91569: [PATCH] decode_utf8 and non-PVs
  https://rt.cpan.org/Ticket/Display.html?id=91569

10 years ago[perl #119801] Stop @DB::dbline modifications from crashing
Father Chrysostomos [Tue, 29 Oct 2013 04:59:14 +0000 (21:59 -0700)]
[perl #119801] Stop @DB::dbline modifications from crashing

The cop address for each breakable line was being stored in the IVX
slot of ${"_<$file"}[$line].  This value itself, writable from Perl
space, was being used as the address of the op to be flagged, whenever
a breakpoint was set.

This meant writing to ${"_<$file"}[$line] and assigning a number (like
42) would cause perl to use 42 as an op address, and crash when trying
to flag the op.

Furthermore, since the array holding the lines could outlive the ops,
setting a breakpoint on the op could write to freed memory or to an
unrelated op (even a different type), potentially changing the beha-
viour of unrelated code.

This commit solves those pitfalls by moving breakpoints into a global
breakpoint bitfield.  Dbstate ops now have an extra field on the end
holding a sequence number, representing which bit holds the breakpoint
for that op.

10 years agoperlio.h: Indent nested #if
Karl Williamson [Sat, 21 Dec 2013 23:48:48 +0000 (16:48 -0700)]
perlio.h: Indent nested #if

I found this helpful in tracking down an issue, being able to
conveniently pair an #endif with its corresponding #if.  The rest of the
file could stand this sort of treatment, but not from me now.

10 years agolib/locale.t: Pass AIX failures
Karl Williamson [Sat, 21 Dec 2013 20:04:44 +0000 (13:04 -0700)]
lib/locale.t: Pass AIX failures

Some AIX locales call a no-break space "graphic".  Rather than fail AIX
for this, this commit adopts the same approach used for MSWin, which
similarly has most locales containing some errors.  And that is to pass
it if any locales at all are correct.  Ideally the vendors wouldn't make
broken locales, but this allows us to test for full legality on other
systems.

10 years agolib/locale.t: Typo in comment
Karl Williamson [Sat, 21 Dec 2013 20:04:17 +0000 (13:04 -0700)]
lib/locale.t: Typo in comment

10 years agoperlunicode: Nits
Karl Williamson [Sat, 21 Dec 2013 17:49:15 +0000 (10:49 -0700)]
perlunicode: Nits

This mostly makes things you could type in your program display in
constant width.  It also adds hyperlinks, and a couple of wording
changes for clarification.

10 years agoperlunicode: Note Bidi_Class changed in Unicode 6.3
Karl Williamson [Sat, 21 Dec 2013 16:55:32 +0000 (09:55 -0700)]
perlunicode: Note Bidi_Class changed in Unicode 6.3

This property had been stable for many Unicode releases, but it is not
guaranteed to be stable, and in fact changed in 6.3.  I left in the
existing list of property values (noting that others have been added)
because they are referred to elsewhere in the pod, and provide a
reasonable example of how multi-valued properties work.

The text used the term "property" to refer to what is properly called
"property values", and used the term "class" to refer to what should
have been called "property".  There is another instance of this
confusion of terms in the pod, which will be corrected in a future
commit

10 years agoperluniintro: Nits
Karl Williamson [Fri, 20 Dec 2013 19:10:16 +0000 (12:10 -0700)]
perluniintro: Nits

10 years agoBump File::Copy to version 2.29.
Craig A. Berry [Sat, 21 Dec 2013 15:59:09 +0000 (09:59 -0600)]
Bump File::Copy to version 2.29.

10 years agoSimplify and clarify VMS specifics in File::Copy.
Craig A. Berry [Sat, 21 Dec 2013 15:48:29 +0000 (09:48 -0600)]
Simplify and clarify VMS specifics in File::Copy.

4c38808d92b95 added some logic to make a "to" path with no
directory component inherit from the current working directory
rather than the directory portion of the "from" path.  It also
added a trailing dot to make null file types unambiguous.  But
the comments emphasized the latter and made no mentin of the
former, and the implementation was unnecessarily complex.

10 years agoRevert "Unix compatibility mode" in File::Copy on VMS.
Craig A. Berry [Sat, 21 Dec 2013 14:33:36 +0000 (08:33 -0600)]
Revert "Unix compatibility mode" in File::Copy on VMS.

This backs out the changes introduced in fc06fdeb76c89.  On
reflection, it doesn't make any sense to support what is actually
a Unix *report* mode in an API that does not report filenames.

File::Copy just needs to supply names to the underlying copy
functions that they can operate on.  How those names are presented
is of no concern here as we don't present them to the caller.

10 years agoFix typo introduced in 4c38808d92b95.
Craig A. Berry [Sat, 21 Dec 2013 14:28:23 +0000 (08:28 -0600)]
Fix typo introduced in 4c38808d92b95.

The variable name is '$^O' not '-$^O'.  This meant File::Copy::move
didn't put the file in the current working directory when the to
argument had no path component.

10 years agoModule-CoreList prepared for v5.19.8
Chris 'BinGOs' Williams [Sat, 21 Dec 2013 11:32:56 +0000 (11:32 +0000)]
Module-CoreList prepared for v5.19.8

10 years agoCoreList on CPAN is 3.02
Chris 'BinGOs' Williams [Sat, 21 Dec 2013 11:07:23 +0000 (11:07 +0000)]
CoreList on CPAN is 3.02

10 years agoFix unescaped first character in tovmsspec.
Craig A. Berry [Sat, 21 Dec 2013 00:11:15 +0000 (18:11 -0600)]
Fix unescaped first character in tovmsspec.

Passing a path to int_tovmsspec that contained an "extended"
character as the first character when converting a Unix filespec
to VMS format skipped escaping that character, but only when the
path spec had no directory component.  The character that didn't
get escaped could then be passed to a native service that choked
or incorrectly processed it.  For example ' foo.txt' remained,
after translation, ' foo.txt', but parsing that as a native spec
would squeeze out the leading space.

So we now make sure we don't eat the first character of the
filename component while processing the directory component and
also handle escaping the very first character.  In the example
of ' foo.txt', it now gets correctly translated to '^_foo.txt'.

10 years agosuppress duplicate line in perliol.h
Christian Millour [Fri, 20 Dec 2013 17:25:27 +0000 (18:25 +0100)]
suppress duplicate line in perliol.h

10 years agoBump version number from 5.19.7 to 5.19.8.
Abigail [Fri, 20 Dec 2013 21:55:02 +0000 (22:55 +0100)]
Bump version number from 5.19.7 to 5.19.8.

10 years agoGenerate new perldelta
Abigail [Fri, 20 Dec 2013 21:47:43 +0000 (22:47 +0100)]
Generate new perldelta

10 years agoRecord epigraph of 5.19.7
Abigail [Fri, 20 Dec 2013 21:28:52 +0000 (22:28 +0100)]
Record epigraph of 5.19.7

10 years agoDocument 5.19.7
Abigail [Fri, 20 Dec 2013 16:43:19 +0000 (17:43 +0100)]
Document 5.19.7

10 years agoAcknowledgement section
Abigail [Fri, 20 Dec 2013 16:42:22 +0000 (17:42 +0100)]
Acknowledgement section

10 years agoMention the fact CGI is deprecated in the list of updated modules as well.
Abigail [Fri, 20 Dec 2013 16:25:19 +0000 (17:25 +0100)]
Mention the fact CGI is deprecated in the list of updated modules as well.

It fits the pattern.

10 years agoMore borderplate removal
Abigail [Fri, 20 Dec 2013 16:14:13 +0000 (17:14 +0100)]
More borderplate removal

10 years agoDocument module changes.
Abigail [Fri, 20 Dec 2013 16:08:38 +0000 (17:08 +0100)]
Document module changes.

./perl -Ilib Porting/corelist-perldelta.pl --mode=update pod/perldelta.pod

10 years agoUpdate Module::CoreList for 5.19.7
Abigail [Fri, 20 Dec 2013 15:47:49 +0000 (16:47 +0100)]
Update Module::CoreList for 5.19.7

10 years agoUpdate perldelta.
Abigail [Fri, 20 Dec 2013 13:57:05 +0000 (14:57 +0100)]
Update perldelta.

Added a few issues from git log v5.19.6..HEAD that had not been added
to perldelta yet.

Removed sections that will not be needed in the final version.

10 years agoregen pod issues
Father Chrysostomos [Fri, 20 Dec 2013 06:19:35 +0000 (22:19 -0800)]
regen pod issues

10 years agoFix string corruption with (??{}) and PERL_NO_COW
Father Chrysostomos [Fri, 20 Dec 2013 06:06:47 +0000 (22:06 -0800)]
Fix string corruption with (??{}) and PERL_NO_COW

Commit 9ffd39ab75, which allowed PADTMPs’ string buffers to be stolen,
caused "$a$b" =~ /(??{})/ to cause string corruption with match varia-
bles on some systems, because the buffer from "$a$b"’s return value
was being stolen when ‘copied’ into a new $_ for the code block.

The string copy necessary for $& and $1 to work would happen only
after the code block’s $_ had been freed, and consequently after the
string buffer had been freed.

Whether this would cause observable buggy behaviour (as opposed to
things only memory tools like valgrind would catch) depended on
whether the malloc implementation would modify the string immediately
when freeing it.

Dave Mitchell observed in <20131218113448.GN2490@iabyn.com> that tests
were failing under -DPERL_NO_COW.  The added test will also fail (for
me at least) under copy-on-write, because the string is long enough to
favour swiping the buffer.  (It happens for me only on Linux, not Dar-
win, incidentally.)

Copying the string with _nosteal fixes the problem.

10 years agoMerge branch 'perldelta' into blead
Steve Hay [Thu, 19 Dec 2013 17:53:01 +0000 (17:53 +0000)]
Merge branch 'perldelta' into blead

Add a new mode to Porting/corelist-perldelta.pl to update the module
changes in pod/perldelta.pod for the perl you are currently building.

This can be run as:

./perl -Ilib Porting/corelist-perldelta.pl --mode=update pod/perldelta.pod

*after* updating Module::CoreList with something like:

./perl -Ilib Porting/corelist.pl cpan

There is still scope for improvement in the handling of removed modules,
and in automatically cribbing information from the Changes files of those
modules that have been updated, but this is a big step in the right
direction.

10 years agoPorting/corelist-perldelta.pl - Minor tidy-ups
Steve Hay [Thu, 19 Dec 2013 17:25:28 +0000 (17:25 +0000)]
Porting/corelist-perldelta.pl - Minor tidy-ups

10 years agoUpdate various instructions about the use of Porting/corelist-perldelta.pl
Steve Hay [Tue, 17 Dec 2013 08:49:33 +0000 (08:49 +0000)]
Update various instructions about the use of Porting/corelist-perldelta.pl

10 years agoAdd Abir Viqar to AUTHORS
Steve Hay [Tue, 17 Dec 2013 08:26:17 +0000 (08:26 +0000)]
Add Abir Viqar to AUTHORS

10 years agoPorting/corelist-perldelta.pl - Make documentation clearer
Abir Viqar [Sat, 14 Dec 2013 19:07:28 +0000 (14:07 -0500)]
Porting/corelist-perldelta.pl - Make documentation clearer

* Fix incorrect usage example for update
* Document that removed modules are currently ignored
* Clarify why some distributions have to be manually checked
* Clarify why a distribution may not be listed in Module::CoreList

10 years agoPorting/corelist-perldelta.pl - Skip dummy items during update
Abir Viqar [Sat, 14 Dec 2013 19:06:35 +0000 (14:06 -0500)]
Porting/corelist-perldelta.pl - Skip dummy items during update

10 years agoPorting/corelist-perldelta.pl - Use Unix newlines in perldelta
Abir Viqar [Sat, 14 Dec 2013 19:05:43 +0000 (14:05 -0500)]
Porting/corelist-perldelta.pl - Use Unix newlines in perldelta

10 years agoPorting/corelist-perldelta.pl - Default to comparing last two versions
Abir Viqar [Sat, 14 Dec 2013 19:03:59 +0000 (14:03 -0500)]
Porting/corelist-perldelta.pl - Default to comparing last two versions

do_update_existing() previously required versions to be specified

10 years agoPorting/corelist-perldelta.pl - Make do_generate use DeltaUpdater
Abir Viqar [Tue, 22 Oct 2013 17:31:18 +0000 (13:31 -0400)]
Porting/corelist-perldelta.pl - Make do_generate use DeltaUpdater

DeltaUpdater::sections_to_pod() makes generate_section() redundant

10 years agoPorting/corelist-perldelta.pl - Add a new mode update
Abir Viqar [Sun, 6 Oct 2013 14:58:27 +0000 (10:58 -0400)]
Porting/corelist-perldelta.pl - Add a new mode update

This adds a new mode, update, which given an the path to an existing
perldelta file, will add missing entries and update incorrect version
information.

This commit introduces a new module, DeltaUpdater, which is used
for pod manipulation.

10 years agoPorting/corelist-perldelta.pl - Make do_check less noisy
Abir Viqar [Thu, 3 Oct 2013 21:14:34 +0000 (17:14 -0400)]
Porting/corelist-perldelta.pl - Make do_check less noisy

The removed modules as returned by corelist_perldelta contains
too many false positives to be useful. Also, explictly state
whether the difference is from the pod or the results returned from
corelist_perldelta().

10 years agoPorting/corelist-perldelta.pl - Improve corelist_delta
Abir Viqar [Thu, 3 Oct 2013 21:01:54 +0000 (17:01 -0400)]
Porting/corelist-perldelta.pl - Improve corelist_delta

corelist_delta now goes through almost all of the core distributions.
The problem with the previous approach was that the keys of %Modules in
Porting/Maintainers.pl do not all correspond to a valid distribution or
do not correspond to a module as listed in Module::CoreList.
This commit also updates the callers of the function.

10 years agoPorting/corelist-perldelta.pl - Cleanup DeltaParser
Abir Viqar [Thu, 3 Oct 2013 20:48:34 +0000 (16:48 -0400)]
Porting/corelist-perldelta.pl - Cleanup DeltaParser

* Comment generation of accessor methods
* Make _parse_delta() more explicit by calling the section parsing
  methods explicitly
* Ensure that the new_modules, updated_modules, and removed_modules
  attributes exist even if the perldelta file does not contain the
  corresponding sections

10 years agoPorting/corelist-perldelta.pl - Improve version parsing
Abir Viqar [Thu, 3 Oct 2013 20:44:38 +0000 (16:44 -0400)]
Porting/corelist-perldelta.pl - Improve version parsing

Catch more forms of how updated modules have been listed in past
perldelta

10 years agoPorting/corelist.pl - DeltaParser: match modules in L<> and C<>
Abir Viqar [Thu, 3 Oct 2013 20:40:13 +0000 (16:40 -0400)]
Porting/corelist.pl - DeltaParser: match modules in L<> and C<>

Module names have been listed in both

10 years agoPorting/corelist-perldelta.pl - Remove trailing whitespace
Abir Viqar [Thu, 3 Oct 2013 20:36:26 +0000 (16:36 -0400)]
Porting/corelist-perldelta.pl - Remove trailing whitespace

10 years agoPorting/corelist-perldelta.pl - fix usage example
Abir Viqar [Sun, 6 Oct 2013 14:52:21 +0000 (10:52 -0400)]
Porting/corelist-perldelta.pl - fix usage example

lib needs to be included when generating the module changes
with the currently build Perl

10 years agoPorting/corelist-perldelta.pl - Use Module::CoreList in dist/
Abir Viqar [Thu, 3 Oct 2013 20:32:42 +0000 (16:32 -0400)]
Porting/corelist-perldelta.pl - Use Module::CoreList in dist/

Ensure that the latest version of Module::CoreList is used when
running the script