This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perl5.git
10 years agoregcomp.c: Add some asserts()
Karl Williamson [Tue, 23 Jul 2013 15:25:36 +0000 (09:25 -0600)]
regcomp.c: Add some asserts()

Now that inversion lists are their own scalar types, we can verify that
the parameters to their manipulation functions are indeed inversion
lists.  This adds such assertions to the bottom level code that deals
with the bare metal of the scalars.  Functions that call these (even if
only in other asserts) didn't have asserts added to them, as they call
these anyway.

10 years agoMerge the install_lib.pl/installman/installperl refactoring into blead.
Nicholas Clark [Tue, 23 Jul 2013 12:36:03 +0000 (14:36 +0200)]
Merge the install_lib.pl/installman/installperl refactoring into blead.

10 years agoinstall_lib.pl's samepath() should not warn if $p1 does not exist.
Nicholas Clark [Sun, 14 Jul 2013 09:44:20 +0000 (11:44 +0200)]
install_lib.pl's samepath() should not warn if $p1 does not exist.

If $p1 is a non-existent path, then the two paths can't be the same, so
samepath() should promptly return false.

10 years agoIn install_lib.pl, no need to Config->import for the relocatableinc setup.
Nicholas Clark [Sun, 14 Jul 2013 09:12:17 +0000 (11:12 +0200)]
In install_lib.pl, no need to Config->import for the relocatableinc setup.

require Config; within the BEGIN block instead of using it outside it to
save creating one implicit BEGIN block, and running its import twice.

Remove the require 5.004; as the require of Config will fail if running
with anything other than the version about to be installed.

Note in installperl and installman that install_lib.pl imports Config.

10 years agoMove the wrapper for File::Path::mkpath() to install_lib.pl
Nicholas Clark [Sat, 13 Jul 2013 18:50:44 +0000 (20:50 +0200)]
Move the wrapper for File::Path::mkpath() to install_lib.pl

installperl and installman call File::Path::mkpath with identical arguments
and options, so move the repeated code into a single place.

10 years agoMove {safe_,}rename() from install{man,perl} into install_lib.pl
Nicholas Clark [Sat, 13 Jul 2013 16:33:53 +0000 (18:33 +0200)]
Move {safe_,}rename() from install{man,perl} into install_lib.pl

installman's rename() was identical to installperl's safe_rename() in all
but name (and whitespace), so de-duplicate by moving the code to
install_lib.pl

10 years ago[perl #74798] fix the build for -Duseithreads
Tony Cook [Tue, 23 Jul 2013 01:48:54 +0000 (11:48 +1000)]
[perl #74798] fix the build for -Duseithreads

10 years agoFix missing single quote in a sed in hints/aix.sh
Peter Martini [Sun, 21 Jul 2013 22:45:45 +0000 (18:45 -0400)]
Fix missing single quote in a sed in hints/aix.sh

10 years agoepigraphs.pod: Fix too long verbatim lines
Karl Williamson [Tue, 23 Jul 2013 00:01:30 +0000 (18:01 -0600)]
epigraphs.pod: Fix too long verbatim lines

The new 5.19.2 epigraph is prose, so it can just be block-quoted
instead of verbatim.

This commit also fixes the 5.13.11 epigraph, which already had some long
lines wrapped.

10 years agoperldelta for 1d5bb6ba43b89
Tony Cook [Tue, 23 Jul 2013 00:38:57 +0000 (10:38 +1000)]
perldelta for 1d5bb6ba43b89

10 years ago[perl #116190] -F implies -a, either implies -n
Tony Cook [Tue, 23 Jul 2013 00:24:45 +0000 (10:24 +1000)]
[perl #116190] -F implies -a, either implies -n

Previously -F without -a was a no-op, and -a without -n or -p was a
no-op, with this change, if you supply -F then both -a and -n are
implied (you can still use -p for its extra behaviour), and if you
supply -a then -n is implied.

10 years ago[perl #116190] feed an empty stdin to run_multiple_progs() programs
Tony Cook [Tue, 16 Jul 2013 04:57:20 +0000 (14:57 +1000)]
[perl #116190] feed an empty stdin to run_multiple_progs() programs

Two tests for -a were attempting to read stdin and blocking with the -a
implies -n change.

10 years ago[perl #116190] -F and -a now imply -n
Tony Cook [Tue, 16 Jul 2013 02:11:55 +0000 (12:11 +1000)]
[perl #116190] -F and -a now imply -n

10 years ago[perl #116190] use the true and trusted fresh_perl_is()
Tony Cook [Tue, 16 Jul 2013 02:00:41 +0000 (12:00 +1000)]
[perl #116190] use the true and trusted fresh_perl_is()

instead of re-inventing it yet again

10 years agoMake the -F switch imply -a
Aristotle Pagaltzis [Wed, 9 Jan 2013 10:26:56 +0000 (11:26 +0100)]
Make the -F switch imply -a

10 years agoperldelta for 059639d5cdd
Tony Cook [Mon, 22 Jul 2013 23:52:29 +0000 (09:52 +1000)]
perldelta for 059639d5cdd

10 years agobump version for Data-Dumper
Tony Cook [Mon, 22 Jul 2013 23:46:55 +0000 (09:46 +1000)]
bump version for Data-Dumper

I had a stray 5.19.2 tag (possibly from testing a few weeks back) that
allowed cmp_version.t to pass

10 years ago[perl #74798] improved useqq compatibility with the pure perl version
Tony Cook [Mon, 22 Jul 2013 23:18:41 +0000 (09:18 +1000)]
[perl #74798] improved useqq compatibility with the pure perl version

Currently for non-useqq, the pure perl and XS output for numbers like
these is different, but XS useqq is new, so try to remain vaguely
compatible.

10 years agoAvoid read-after-free in S_scan_heredoc() if the terminator line has no "\n".
Nicholas Clark [Thu, 27 Jun 2013 16:09:32 +0000 (18:09 +0200)]
Avoid read-after-free in S_scan_heredoc() if the terminator line has no "\n".

The code added by commit 112d128413206514 to fix RT #65838 (Allow here-doc
with no final newline) could in some rare cases cause a read of free()d
memory during parsing. The code itself is only run if the Perl program
ends with a heredoc (which is an unusual structure), and if the last line of
the file on disk has no terminating newline character (which is also unusual,
as many editors default to adding a final newline). The bug would be
triggered if the fixup code in S_scan_heredoc() triggered a reallocation of
the buffer in PL_linestr when adding a newline to it.

10 years agoModule-CoreList is 2.94 on CPAN now
Chris 'BinGOs' Williams [Mon, 22 Jul 2013 10:55:23 +0000 (11:55 +0100)]
Module-CoreList is 2.94 on CPAN now

10 years agoUpdate Module-Build to CPAN version 4.007
Chris 'BinGOs' Williams [Mon, 22 Jul 2013 08:41:01 +0000 (09:41 +0100)]
Update Module-Build to CPAN version 4.007

  [DELTA]

0.4007 - Fri Jul 19 13:44:39 CEST 2013

  [BUG FIXES]

  - Removed undeclared test dependency on parent.pm [Leon Timmermans]

  - Declared dependency on Pod::Man 2.17 for utf8 support [Leon Timmermans]

  - Force generation of man pages in manify_with_utf8.t [Leon Timmermans]

0.4006 - Thu Jul 18 14:19:49 CEST 2013

  [ENHANCEMENTS]

  - Significantly sped up some tests by not forcing HTML docs to be
    built when the user's config doesn't ask for them anyway.
    [Ken Williams]

  - The Module::Metadata package was split out from this distro back
    in 2010.  Removed its regression tests. [Ken Williams]

  - Removed dependence on IO::File, replacing it with safe invocations
    of open(). [Sven Dowideit]

  - Added an 'extra_manify_args' parameter to facilitate man pages
    containing Unicode. [Joenio Costa]

  - Added an '--html_links 0' argument for the 'html' action, which
    can hugely speed things up.  The main effect is speeding up the
    M::B tests themselves. [Ken Williams]

  [BUG FIXES]

  - Fix hash argument parsing in subclasses [Graham Ollis]

  - Revised detildification on VMS [Craig Berry]

  - Fix run_test_harness for case when $Switches is an empty string
    [Victor Efimov, Ken Williams]

10 years agoUpdate IPC-SysV to CPAN version 2.04
Chris 'BinGOs' Williams [Mon, 22 Jul 2013 08:28:39 +0000 (09:28 +0100)]
Update IPC-SysV to CPAN version 2.04

  [DELTA]

  2.04 - 2013-07-20

    * CPAN #72458: Add 'all' export
      (thanks to Milan Kocian for providing a patch)
    * CPAN #79821: Install to 'site' for perl 5.11+
      (thanks to Robert Sedlacek for providing a patch)
    * CPAN #86736: Fix spelling of IPC_CREAT
    * CPAN #78882: Document SIZE parameter of IPC::SharedMem->new()
    * CPAN #78927: Fix spelling of 'nattch'

10 years agoMerge the work which improves test diagnostics from run_multiple_progs().
Nicholas Clark [Mon, 22 Jul 2013 08:09:50 +0000 (10:09 +0200)]
Merge the work which improves test diagnostics from run_multiple_progs().

10 years agoReport useful file names and line numbers from run_multiple_progs().
Nicholas Clark [Mon, 15 Jul 2013 09:27:22 +0000 (11:27 +0200)]
Report useful file names and line numbers from run_multiple_progs().

Previously if tests in run_multiple_progs() failed the report gave the file
name and line number of the ok() call in run_multiple_progs(). Now, where
possible, report the file and line of the actual test program. If this
information isn't available, report the error at the file and line which
called run_multiple_progs().

This will improve error reporting from lib/charnames.t, lib/feature.t,
lib/strict.t, lib/subs.t, lib/warnings.t and t/lib/croak.t

10 years agoRemove a duplicate test separator "########\n" line from the pp_sys tests.
Nicholas Clark [Mon, 15 Jul 2013 09:13:48 +0000 (11:13 +0200)]
Remove a duplicate test separator "########\n" line from the pp_sys tests.

The existing parser using split includes the second "########\n" as part of
the extracted test program, which the Perl interpreter treats as a comment
line. The parser refactoring in the next commit no longer adds the line to
the extracted test program, causing the line numbers for the warnings to
differ by one.

The extra "########\n" was added as part of commit c521cf7c8af1697e in Dec
2010, along with the test program which follows it, and the (now) incorrect
line number expectations.

10 years agoMerge the file parsing code for run_multiple_progs() into _setup_one_file().
Nicholas Clark [Sun, 14 Jul 2013 18:44:50 +0000 (20:44 +0200)]
Merge the file parsing code for run_multiple_progs() into _setup_one_file().

setup_multiple_progs() calls _setup_one_file() to parse each file in turn,
and run_multiple_progs() calls it once if passed a file handle.

10 years agoMove file parsing code from t/lib/common.pl to t/test.pl
Nicholas Clark [Sun, 14 Jul 2013 16:58:58 +0000 (18:58 +0200)]
Move file parsing code from t/lib/common.pl to t/test.pl

Move the code that prepares input to run_multiple_progs() by parsing files
into a subroutine setup_multiple_progs(). This will enable the parsing code
in run_multiple_progs() to be merged, and the combined code to be altered to
give improved diagnostics on test failure.

10 years agoRefactor the setup code in t/lib/common.pl
Nicholas Clark [Sun, 14 Jul 2013 15:29:59 +0000 (17:29 +0200)]
Refactor the setup code in t/lib/common.pl

Eliminate the variable $line which has never been used.
(The code was added by commit bd4dea8e97f4a8f5 in June 2001.)
Use a non-capturing group in a regex.
Check the return value of close and die if there is an error.
Explicitly count the tests found.
Avoid indirect object syntax for a method call.

10 years agolib/warnings.t should actually run the test in t/lib/warnings/doop
Nicholas Clark [Mon, 15 Jul 2013 07:48:02 +0000 (09:48 +0200)]
lib/warnings.t should actually run the test in t/lib/warnings/doop

The file containing a single test for a warning in doop.c was added by
commit 0453d815b8a74697 in June 1999. However, as the file does not contain
an __END__ marker, the parser skips the entire contents of the file looking
for the __END__, and then assumes that the file contains no tests. This has
been true since the parser code was first implemented (in t/pragma/warning.t)
in commit 8ebc5c0145d2e355 in Jan 1997.

The simplest fix is to add an __END__ to the start of t/lib/warnings/doop
Also add some sanity checking to ensure that this doesn't happen again.

10 years agosimplify README.macosx instructions
Aristotle Pagaltzis [Mon, 22 Jul 2013 07:38:58 +0000 (09:38 +0200)]
simplify README.macosx instructions

This also removes a repeating version bumping bug.

10 years agofix my stupid perlhist typo
Aristotle Pagaltzis [Mon, 22 Jul 2013 07:28:12 +0000 (09:28 +0200)]
fix my stupid perlhist typo

10 years agostub CoreList for v5.19.3
Aristotle Pagaltzis [Mon, 22 Jul 2013 07:07:37 +0000 (09:07 +0200)]
stub CoreList for v5.19.3

10 years agobump version to v5.19.3
Aristotle Pagaltzis [Mon, 22 Jul 2013 07:05:44 +0000 (09:05 +0200)]
bump version to v5.19.3

10 years agocreate fresh perldelta
Aristotle Pagaltzis [Mon, 22 Jul 2013 06:39:56 +0000 (08:39 +0200)]
create fresh perldelta

10 years agoadd v5.19.2 epigraph
Aristotle Pagaltzis [Mon, 22 Jul 2013 06:33:12 +0000 (08:33 +0200)]
add v5.19.2 epigraph

10 years agoupdate perlhist for v5.19.2 release v5.19.2
Aristotle Pagaltzis [Mon, 22 Jul 2013 04:09:31 +0000 (06:09 +0200)]
update perlhist for v5.19.2 release

10 years agoupdate perldelta for v5.19.2 release
Aristotle Pagaltzis [Mon, 22 Jul 2013 04:09:04 +0000 (06:09 +0200)]
update perldelta for v5.19.2 release

10 years agoupdate Module::CoreList for v5.19.2 release
Aristotle Pagaltzis [Mon, 22 Jul 2013 02:45:01 +0000 (04:45 +0200)]
update Module::CoreList for v5.19.2 release

10 years agoUpdate Socket to CPAN version 2.010
Aristotle Pagaltzis [Sun, 21 Jul 2013 04:43:47 +0000 (06:43 +0200)]
Update Socket to CPAN version 2.010

[DELTA]

2013/06/24
2.010   CHANGES:
         * Wrap some IPTOS_* constants, which may come from <netinet/ip.h>
         * Probe for and optionally include <netinet/ip.h>
         * Defeat C compilers' attempts to optimise away configure-time probes
           for functions that are never called

10 years agoClarify av_shift API docs
Steffen Mueller [Sat, 20 Jul 2013 15:53:08 +0000 (17:53 +0200)]
Clarify av_shift API docs

10 years agoperldelta: #118931 is a known issue
Father Chrysostomos [Sat, 20 Jul 2013 00:58:06 +0000 (17:58 -0700)]
perldelta: #118931 is a known issue

10 years agoBenchmark.t: remove CPU-speed-sensitive test
David Mitchell [Fri, 19 Jul 2013 22:10:50 +0000 (23:10 +0100)]
Benchmark.t: remove CPU-speed-sensitive test

Benchmark.t has been randomly failing test 15 in smokes for ages.
This is the one that checks that a loop run 3*N times burns approximately
3 times more CPU than when run just N times.

For the last month the test has included a calibration loop and test,
which does much the same thing, but without using any code from
Benchmark.pm. This has failed just as much, which confirms that its an
issue with the smoke host (such as a variable speed CPU or whatever),
rather than any flaw in the Benchmark.pm library logic.

So just remove the calibration loop and the dodgy test.

10 years agomore op_folded support: B, dump
Reini Urban [Thu, 18 Jul 2013 19:50:35 +0000 (14:50 -0500)]
more op_folded support: B, dump

also add more B::OP accessors for the missing bitfields

10 years agoAdd Niels Thykier to AUTHORS
Father Chrysostomos [Fri, 19 Jul 2013 01:51:54 +0000 (18:51 -0700)]
Add Niels Thykier to AUTHORS

10 years agoop.c: Add op_folded to BASEOP
Niels Thykier [Wed, 17 Jul 2013 18:59:54 +0000 (20:59 +0200)]
op.c: Add op_folded to BASEOP

Add a new member, op_folded, to BASEOP.  It is replacement for
OPpCONST_FOLDED (which can only be set on OP_CONST).  At the moment
OPpCONST_FOLDED remains, as it is exposed in B (e.g. B::Concise relies
on it).

Signed-off-by: Niels Thykier <niels@thykier.net>
10 years agotoke.c:yylex: assert that PL_linestr is not a COW
Father Chrysostomos [Wed, 17 Jul 2013 06:29:25 +0000 (23:29 -0700)]
toke.c:yylex: assert that PL_linestr is not a COW

and fix the one bug this uncovers.

With COW enabled all the time, it is easy to introduce bugs like this.
See also 4e917a04.  In short, toke.c expects to be able to modify
PL_linestr’s buffer.  Putting this assertion in yylex (a hot path)
will make sure PL_linestr never becomes a COW again.

10 years agosv.c: Assert that sv_[ivp]v are not passed aggregates
Father Chrysostomos [Fri, 19 Jul 2013 15:51:47 +0000 (08:51 -0700)]
sv.c: Assert that sv_[ivp]v are not passed aggregates

The lack of assertions can hide bugs.  See 32a609747bffb for instance

10 years agolocale.c: Add missing STATIC to fcn decl
Karl Williamson [Fri, 19 Jul 2013 15:50:27 +0000 (09:50 -0600)]
locale.c: Add missing STATIC to fcn decl

10 years agoMove some tests from cpan/version to t/run
Karl Williamson [Wed, 17 Jul 2013 04:02:46 +0000 (22:02 -0600)]
Move some tests from cpan/version to t/run

Commit fb7942811c8097ed2e61fd35a90345226546176a recently moved
version.pm to cpan.  Earlier, in commit
b127e37e51c21b0a36755dcd19811be931a03d83, I had added tests to version's
.t that arguably belonged elsewhere.  I did this because I thought that
this .t was the only one around that had the infrastructure already
written to allow such tests to easily be added, and it was in /lib so
p5p controlled it.  (That infrastructure being finding locales with the
decimal point not a dot.)  Since then, I found that t/run/locale.t has
similar infrastructure.  Given that version now may end up being cpan
upstream, I thought it best to move those tests to t/run/locale.t

I notice that changes to this .t prior to these no longer were careful
to avoid 'use locale' in case the platform doesn't support it, and there
have been no field problems; so I just went ahead and did a 'use locale'
too.

10 years agocpan/version/t/07locale.t: Actually test what is claimed
Karl Williamson [Wed, 17 Jul 2013 04:05:57 +0000 (22:05 -0600)]
cpan/version/t/07locale.t: Actually test what is claimed

Commit b127e37e51c21b0a36755dcd19811be931a03d83 wrongly changed two
tests, and failed to change a third.  One of the two ended up doing:
        ok ("$ver eq '1,23'", ...);
That's always going to succeed as ok() doesn't do an eval; it just looks
at the result of the expression, which in this case was a non-empty
string.

The second test was changed from an 'eq' to '=='.  It had this diff:

 -       is ($v, "1.23", "Locale doesn't apply to version objects");
 +       ok ($v == "1.23", "Locale doesn't apply to version objects");

(The code for is() does an 'eq'.)  The is() call is made from within the
scope of a "use locale" in which the decimal point character is a comma,
but version objects are supposed to always use a dot, regardless of the
locale.  The == will numify the operands, potentially throwing away the
locale's decimal point character.  Therefore the test should use an
'eq'.

Before these changes, the two tests also didn't do what they purported
(and hence the motivation for the changes).  The tests previously used
'is()', which is defined in a different file which is outside the locale
scope, so that the scalars ($v and $ver) there should have a dot even
if they have a comma within locale scope, and hence doing an is() would
not catch the bug being tested against.  Hence the third test
(overlooked in the earlier commit) remained wrong until now.

10 years agosv.h: Comments added/typo fixed.
Karl Williamson [Wed, 17 Jul 2013 04:01:08 +0000 (22:01 -0600)]
sv.h: Comments added/typo fixed.

10 years agoperldelta: minor grammar fixes
Ricardo Signes [Fri, 19 Jul 2013 14:58:23 +0000 (10:58 -0400)]
perldelta: minor grammar fixes

10 years agoremove some instruction bloat in S_find_uninit_var
Daniel Dragan [Sat, 22 Dec 2012 14:34:40 +0000 (09:34 -0500)]
remove some instruction bloat in S_find_uninit_var

VC 2003 -O1 put down SvIV(cSVOPx_sv(kid)) twice in asm. Not sure why.

Explicitly store the values to make it more obvious to the compiler to
evaluate the SvIV only once, then do the branch, not do the negate branch,
then in a negate branch do a SvIV. Result is less machine code read by the
CPU. The .text section dropped 0xC01FF to 0xC018F after this change.

10 years agohandle multiple children exiting in perlipc example
Tony Cook [Fri, 12 Jul 2013 07:12:46 +0000 (17:12 +1000)]
handle multiple children exiting in perlipc example

10 years agopod2html output concerns
Tony Cook [Thu, 11 Jul 2013 07:03:44 +0000 (17:03 +1000)]
pod2html output concerns

10 years agoRemove 5.005 thread support from configure.com.
Craig A. Berry [Thu, 18 Jul 2013 20:19:51 +0000 (15:19 -0500)]
Remove 5.005 thread support from configure.com.

Follow-up to 5ff367e3adebb49.

10 years agoUpdate Parse-CPAN-Meta to CPAN version 1.4405
Chris 'BinGOs' Williams [Thu, 18 Jul 2013 11:30:07 +0000 (12:30 +0100)]
Update Parse-CPAN-Meta to CPAN version 1.4405

  [DELTA]

  1.4405    2013-07-17 21:43:34 America/New_York
      - Fixed incorrect "return ... or die ..." constructs
      - Converted distribution to Dist::Zilla management
      - Noted new repository location in the Github Perl-Toolchain-Gang
        organization

10 years agobisect.pl now accepts repeated -e options, just like perl.
Nicholas Clark [Wed, 17 Jul 2013 10:23:42 +0000 (12:23 +0200)]
bisect.pl now accepts repeated -e options, just like perl.

10 years agoperldelta for =>
Father Chrysostomos [Wed, 17 Jul 2013 06:06:53 +0000 (23:06 -0700)]
perldelta for =>

10 years agoAllow => to quote built-in keywords across lines
Father Chrysostomos [Sat, 13 Jul 2013 06:37:26 +0000 (23:37 -0700)]
Allow => to quote built-in keywords across lines

This is the second try.  5969c5766a5d3 had a bug in it under non-
MAD builds.

If I have a sub I can use its name as a bareword as long as I suffix
it with =>, even if the => is on the next line:

$ ./perl -Ilib -e 'sub tim; warn tim' -e '=>'
tim at -e line 1.

If I want to use a built-in keyword’s name as a bareword, I can put =>
after it:

$ ./perl -Ilib -e 'warn time =>'
time at -e line 1.

But if I combine the two (keyword + newline), it does not work:

$ ./perl -Ilib -e 'warn time' -e ' =>'
1373611283 at -e line 1.

unless I override the keyword:

$ ./perl -Ilib -Msubs=time -e 'warn time' -e ' =>'
time at -e line 1.

=> after a bareword is checked for in two places in toke.c.  The first
comes before a comment saying ‘NO SKIPSPACE BEFORE HERE!’; it only
skips spaces and finds a => on the same line.  The second comes later;
it skips vertical space and comments, too.

But the second check is in a code path that is not reached by keywords
that are not overridden (as is the ‘NO SKIPSPACE’ comment).

This commit adds an extra check for built-in keywords after we have
determined that the keyword is not overridden.  In that case, there is
no reason we cannot use skipspace, as we no longer have to worry about
what PL_oldbufptr etc. point to.

This commit leaves __DATA__ and __END__ alone, since they
are special, problematic and controversial.  (See, e.g.,
<https://rt.perl.org/rt3/Ticket/Display.html?id=78348#txn-1234355>.)

Allowing whitespace to be scanned across line boundaries without
increasing the line number (something this commit has to do to make
this work) can cause the way PL_linestr is handled to change.

PL_linestr usually holds just the current line when reading from a
handle.  Now it can hold the current line plus the next line or seve-
ral lines, depending on how much whitespace is to be found there.

When '\n' or '#' was encountered, the lexer would modify the buffer in
place and add a null, setting PL_bufend to point to that null.  That
would make it look as though the end of the line had been reached, and
avoided having to scan to find the end of a comment.

In string eval and quote-like operators, the end of the comment does
have to be scanned for.  We can’t just fake EOL and read the next
line of input.

Under MAD builds, the end of the comment was being scanned for any-
way, even when reading from a handle.  So everything worked under MAD,
which was what I tested 5969c5766a5d3 under.

This commit changes the '\n' and '#' handling to match the MAD code
(scan for the end of the comment instead of faking a buffer trunca-
tion), which 5969c5766a5d3 failed to do.

10 years agoignore the build product lib/version.pod
Tony Cook [Wed, 17 Jul 2013 01:14:30 +0000 (11:14 +1000)]
ignore the build product lib/version.pod

fb7942811 moved version from lib/ to cpan/ and added most of the needed
lib/.gitignore entries, missing only this one.

10 years ago[perl #74798] useqq implementation for xs
Tony Cook [Wed, 17 Jul 2013 01:09:21 +0000 (11:09 +1000)]
[perl #74798] useqq implementation for xs

10 years agohandle xs Useqq dumping of strings with an escape followed by a digit
Tony Cook [Wed, 10 Jul 2013 04:54:20 +0000 (14:54 +1000)]
handle xs Useqq dumping of strings with an escape followed by a digit

The original patch didn't handle a string like "\x001" correctly, encoding
it as "\01" rather than "\0001".

Added tests for this case and some possible corner cases

10 years agoadjust indentation to match other DD code
Tony Cook [Wed, 10 Jul 2013 04:19:17 +0000 (14:19 +1000)]
adjust indentation to match other DD code

10 years agoData::Dumper: useqq implementation for xs
Slaven Rezic [Wed, 10 Jul 2013 04:18:18 +0000 (14:18 +1000)]
Data::Dumper: useqq implementation for xs

Tests are mainly unchanged, just a "cheat" and a couple of TODOs were
removed.

10 years agoMerge branch 'const_posix_invlists' into blead
Karl Williamson [Tue, 16 Jul 2013 19:59:03 +0000 (13:59 -0600)]
Merge branch 'const_posix_invlists' into blead

This is the second attempt to put this functionality into blead.  The
first was in commit dab1d6f279e5792c6a935eeaeeec652a883df979.  Its
elements had to be backed out because it turns out there were array
bounds errors.  This new commit should have fixed those.  The revised
commit message is:

What characters certain POSIX classes match, like [[:xdigit:]] are
compiled into a C header file, thus avoiding the necessity of reading
them in from disk at run-time.  This merge makes those fully const, so
that they can get loaded as part of a read-only text segment.  The sv's
that contain these are set so that SvLEN is 0; this means that copies
are not made when they are dup'd, such as when threads are created.

A new svtype is created for inversion lists, using the single available
slot, renumbering them.  The first few commits instead use an existing
svtype, repurposing some of its fields for use by inversion lists.  This
was done so that this could be done in a maintenance release, if
necessary.  (Their not being fully const can interfere with
-DPERL_GLOBAL_STRUCT_PRIVATE.)  And also, should it become necessary to
create an svtype for some other purpose, we can revert to that point in
the branch

10 years agoRemove redundant field from inversion lists
Karl Williamson [Fri, 12 Jul 2013 21:11:26 +0000 (15:11 -0600)]
Remove redundant field from inversion lists

The number of elements in an inversion list is a simple calculation
based on SvCUR().  Prior to this patch there was a field that contained
that number directly, and the two values diverged, causing a bug.  A
single value can't get out-of-sync with itself.

10 years agoAdd parameter to internal function
Karl Williamson [Fri, 12 Jul 2013 20:07:49 +0000 (14:07 -0600)]
Add parameter to internal function

The function invlist_set_len() has to be called after the offset header
field in an inversion list has been set.  To make sure that future
maintainers don't forget to do this, add the parameter for the 'offset'
to its call, so it can't be called without having this value.

10 years agoregcomp.c: Rmv now redundant setting
Karl Williamson [Fri, 12 Jul 2013 17:30:16 +0000 (11:30 -0600)]
regcomp.c: Rmv now redundant setting

SvCUR is now properly set in invlist_set_len().  There is no need to do
it outside that function.

10 years agoFix off-by-one error in inversion lists.
Karl Williamson [Fri, 12 Jul 2013 03:56:46 +0000 (21:56 -0600)]
Fix off-by-one error in inversion lists.

The first commit of this topic branch added a dummy 0 element to the end
of certain inversion lists to work around an off-by-one error.  This
commit makes the necessary changes to stop that error, and to remove
the dummy element.  SvCUR() and invlist_len() now are kept in sync.

10 years agoregcomp.c: Reorder a couple of function calls
Karl Williamson [Fri, 12 Jul 2013 01:44:56 +0000 (19:44 -0600)]
regcomp.c: Reorder a couple of function calls

A future commit with require that the offset be known before the length
gets set.  This prepares for that.

10 years agoregcomp.c: Remove now useless initialization
Karl Williamson [Fri, 12 Jul 2013 01:38:53 +0000 (19:38 -0600)]
regcomp.c: Remove now useless initialization

This code was designed to cause a segfault by initializing an offset
into an address to a very large value.  But now, it is stored as a bool,
so there is not point in doing this.  We also remove an assert that it
is a bool, because it always has to be.

10 years agoregcomp.c: Only White-space, comments, name of variable change
Karl Williamson [Fri, 12 Jul 2013 01:16:55 +0000 (19:16 -0600)]
regcomp.c: Only White-space, comments, name of variable change

10 years agoReinstate "Use new Svt_INVLIST for inversion lists."
Karl Williamson [Sat, 6 Jul 2013 21:33:57 +0000 (15:33 -0600)]
Reinstate "Use new Svt_INVLIST for inversion lists."

This reverts commit 2e0b8fbeab3502bee36f25825c3cdd0d075c4fd3, which
reverted e0ce103ae532f9576f54a5938a24d1ee98dfb928, thus reinstating the
latter commit.  It turns out that the error being chased down was not
due to this commit.

Its original message was:

This converts inversion lists to use their own scalar type.

10 years agoReinstate "Create SVt_INVLIST"
Karl Williamson [Sat, 6 Jul 2013 21:29:11 +0000 (15:29 -0600)]
Reinstate "Create SVt_INVLIST"

This reverts commit 49cf1d6641a6dfd301302f616e4f25595dcc65d4, which
reverted e045dbedc7da04e20cc8cfccec8a2e3ccc62cc8b, thus reinstating the
latter commit.  It turns out that the error being chased down was not
due to this commit.

Its original message was:

This reshuffles the svtype enum to remove the dummy slot created in a
previous commit, and add the new SVt_INVLIST type in its proper order.
It still is unused, but since it is an extension of SVt_PV, it must be
greater than that type's enum value.  Since it can't be upgraded to any
other PV type, it comes right after SVt_PV.

 Affected tables in the core are updated.

10 years agoReinstate "regcomp.c: Move some #defines to only file that uses them"
Karl Williamson [Sat, 6 Jul 2013 21:10:14 +0000 (15:10 -0600)]
Reinstate "regcomp.c: Move some #defines to only file that uses them"

This reverts commit 247f9b19318882fd9a52fe49aa31fc8d3d3db4f7, which
reverted 05944450e0fc82eb8fc1fb5a4bf63f23785262a0, thus reinstating the
latter commit.  It turns out that the error being chased down was not
due to this commit.

Its original message was:

These were used in a header file to provide synchronization between
files.  However, the only other file that would need them is a .pl file
which doesn't have access to them.  So simplify things so that the
variables are either removed entirely if only used in a single place, or
are #defined in the area where they are used

10 years agoReinstate "regcomp.c: Make C-array inversion lists const"
Karl Williamson [Sat, 6 Jul 2013 20:56:39 +0000 (14:56 -0600)]
Reinstate "regcomp.c: Make C-array inversion lists const"

This reverts commit 18505f093a44607b687ae5fe644872f835f66313, which
reverted 241136e0ed70738cccd6c4b20ce12b26231f30e5, thus reinstating the
latter commit.  It turns out that the error being chased down was not
due to this commit.

Its original message was:

The inversion lists that are compiled into a C header are now const.

10 years agoReinstate "regcomp.c: Move inversion list hdr field to SV hdr"
Karl Williamson [Sat, 6 Jul 2013 20:44:32 +0000 (14:44 -0600)]
Reinstate "regcomp.c: Move inversion list hdr field to SV hdr"

This reverts commit 2eb2feb9f4a226d0fe0fd3d66e2ce341296f0072, which
reverted d913fb457b732da4c31d0d1b8c085989a7ecd12d, thus reinstating the
latter commit.  It turns out that the error being chased down was not
due to this commit.

Its original message was:

This moves the final field that can vary from the inversion list data
structure into the header of the SV that contains it.  With this commit,
the body of an inversion list is now const.

The field is converted to a U8, to correspond with the header field in
the SV type that we currently use to hold inversion lists.

10 years agoReinstate "regcomp.c: Change, variable, fcn name"
Karl Williamson [Sat, 6 Jul 2013 20:29:35 +0000 (14:29 -0600)]
Reinstate "regcomp.c: Change, variable, fcn name"

This reverts commit 0b58015e05b2ab93b080b7c49a70bf82435363c0, which
reverted 875c4e2c5193b5245da578b222e9c93aad31d93b, thus reinstating the
latter commit.  It turns out that the error being chased down was not
due to this commit.

Its original message was (slightly revised for clarity):

These have always been slightly misnamed, but a recent commit made them
more so.  The old name contained "zero", but now there is a new element
which always has zero.  The renamed element indicates whether the
inversion list is offset, that is if the beginning is the zero element,
or if the beginning is the next element beyond the zero element.

10 years agoReinstate "regcomp.c: Move 2 hdr inversion fields to SV hdr"
Karl Williamson [Sat, 6 Jul 2013 20:13:35 +0000 (14:13 -0600)]
Reinstate "regcomp.c: Move 2 hdr inversion fields to SV hdr"

This reverts commit 67434bafe4f2406e7c92e69013aecd446c896a9a, which
reverted 4fdeca7844470c929f35857f49078db1fd124dbc, thus reinstating the
latter commit.  It turns out that the error being chased down was not
due to this commit.

Its original message was:

This commit continues the process of separating the header area of
inversion lists from the body.  2 more fields are moved out of the
header portion of the inversion list, and into the header portion of the
SV that contains it.

10 years agoReinstate "regcomp.c: Remove unused data structure field"
Karl Williamson [Sat, 6 Jul 2013 19:58:55 +0000 (13:58 -0600)]
Reinstate "regcomp.c: Remove unused data structure field"

This reverts commit c7995b20ccfbb4248b23aeae9fd1eab838852fcc, which
reverted 4b98096221966ea01c046f4f61b2dc4f60b534b9, thus reinstating
the latter commit.  It turns out that the error being chased down was
not due to this commit.

Its original message was:

This removes a field that is set in the inversion list data structure
and examined just once.  And that sole examiner is the function that
calls the function that does the set.  In other words X calls Y passing
it data D.  Y puts D into a structure.  Upon return from Y, X looks for
D in the structure.  No one else looks at D.  X might just as well have
looked at D directly, without involving Y, and without the structure
needing a space for D.

10 years agoReinstate "regcomp.c: Make inversion lists SVt_PVLV"
Karl Williamson [Sat, 6 Jul 2013 18:39:22 +0000 (12:39 -0600)]
Reinstate "regcomp.c: Make inversion lists SVt_PVLV"

This reverts commit ac7a6f5849b5fd57b2e837f4ddbc18c992610e9c which
reverted 2c3365de8c1168f115576a4976d067e3b911c490, thus reinstating the
latter commit.  It turns out that the error being chased down was not
due to this commit.

This commit additionally changes some now-obsolete wording in a pod.
This change was not in 2c3365de8c1168f115576a4976d067e3b911c490.

The original message for commit 2c3365de8c1168f115576a4976d067e3b911c490
was:

This is the 2nd step in separating the inversion list body from header.
This commit gives inversion lists the header from a SVt_PVLV, and
repurposes one of its fields into being the length of the inversion
list.

This is a temporary measure, in case binary compatibility is an issue.
Future commits will create a new SV type just for inversion lists.  This
SV type was chosen because it has a sufficient number of fields to
accommodate all the header fields from inversion lists.

10 years agoReinstate + fix "Revert "regcomp.c: Add a constant 0 element before inversion lists" "
Karl Williamson [Sat, 6 Jul 2013 18:26:43 +0000 (12:26 -0600)]
Reinstate + fix "Revert "regcomp.c: Add a constant 0 element before inversion lists" "

This reverts commit de353015643cf10b437d714d3483c1209e079916 which
reverted 533c4e2f08b42d977e5004e823d4849f7473d2d0, thus reinstating it,
plus this commit adds a fix to get it to pass under Address Sanitizer.

The root cause of the problem is that there are two measures of the
length of an inversion list.  One is SvCUR(), and the other is
invlist_len().  The original commit caused these to get off-by-one in
some cases.  The ultimate solution is to only store one value, and
return the other one based off that.  Rather than redo the whole branch,
I've taken an easier way out, which is to add a dummy element at the end
of some inversion lists, so that they aren't off-by-one.  Then the other
patches from the original branch will be applied.  Each will be
tested with Address Sanitizer.  Then the work to fix the underlying
problem will be done.

The original commit's message was:

This commit is the first step to separating the header from the body of
inversion lists.  Doing so will allow the compiled-in inversion lists to
be fully read-only.

To invert an inversion list, one simply unshifts a 0 to the front of it
if one is not there, and shifts off the 0 if it does have one.

The current data structure reserves an element at the beginning of each
inversion list that is either 0 or 1.  If 0, it means the inversion list
begins there; if 1, it means the inversion list starts at the next
element.  Inverting involves flipping this bit.

This commit changes the structure so that there is an additional element
just after the element that flips.  This new element is always 0, and
the flipping element now says whether the inversion list begins at the
constant 0 element, or the one after that.

Doing this allows the flipping element to be separated in later commits
from the body of the inversion list, which will always begin with the
constant 0 element.  That means that the body of the inversion list can
be const.

10 years agoembed.fnc: Clarify comments on E,X flag usage; nit
Karl Williamson [Tue, 16 Jul 2013 18:41:45 +0000 (12:41 -0600)]
embed.fnc: Clarify comments on E,X flag usage; nit

10 years agoMove version from lib/ to cpan/
Nicholas Clark [Tue, 16 Jul 2013 09:23:50 +0000 (11:23 +0200)]
Move version from lib/ to cpan/

Whilst there are still several differences between what's in core and what's
in the CPAN tarball, moving the files in core to their own directory with
the same layout as the CPAN distribution simplifies things.

Somewhat surprisingly, none of the toolchain modules C<use version;> so
there's no need to add to lib/buildcustomize.pl

10 years agoperldelta for #27010
Father Chrysostomos [Tue, 16 Jul 2013 06:52:44 +0000 (23:52 -0700)]
perldelta for #27010

10 years ago[perl #27010] Make tie work through defelems
Father Chrysostomos [Tue, 16 Jul 2013 06:51:15 +0000 (23:51 -0700)]
[perl #27010] Make tie work through defelems

When elements of @_ refer to nonexistent hash or array elements, then
the magic scalar in $_[0] delegates all set/get actions to the element
in represents, vivifying it if needed.

tie/tied/untie, however, were not delegating to the element, but were
tying the the magical ‘deferred element’ scalar itself.

10 years agoembed.fnc: E does not imply X
Father Chrysostomos [Tue, 16 Jul 2013 05:49:31 +0000 (22:49 -0700)]
embed.fnc: E does not imply X

I thought it did.

10 years agoConvert lib/FileHandle.t to use of Test::More; provide descriptions.
James E Keenan [Wed, 10 Jul 2013 02:13:10 +0000 (04:13 +0200)]
Convert lib/FileHandle.t to use of Test::More; provide descriptions.

Previously, file used hand-coded 'print "ok"' statements and no tests had
descriptions (a.k.a. labels or names).  Convert to use of Test::More functions
and provide descriptions for all individual tests.

Previously, file used global variables extensively and did not 'use strict'
(except 'use strict subs').  The globals have been converted to lexicals
where appropriate and the file now runs fully under strictures.  Other
than that, no attempt was made to improve the design of the file or the
quality of the tests.  (That can be done in a later RT, if desired.)

Thanks to Peter Martini for guidance, Dagfinn Ilmari Mannsåker for guidance
and code review on list and Tony Cook for additional review.

For: RT #118883

10 years agoperldelta for #77814
Father Chrysostomos [Tue, 16 Jul 2013 02:00:21 +0000 (19:00 -0700)]
perldelta for #77814

10 years ago[perl #77814] Make defelems propagate pos
Father Chrysostomos [Tue, 16 Jul 2013 01:57:01 +0000 (18:57 -0700)]
[perl #77814] Make defelems propagate pos

When elements of @_ refer to nonexistent hash or array elements, then
the magic scalar in $_[0] delegates all set/get actions to the element
in represents, vivifying it if needed.

pos($_[0]), however, was not delegating the value to the element, but
storing it on the magical ‘deferred element’ scalar.

10 years agoperldelta for vstrings and set-magic
Father Chrysostomos [Mon, 15 Jul 2013 07:21:55 +0000 (00:21 -0700)]
perldelta for vstrings and set-magic

10 years agoMake set-magic handle vstrings properly
Father Chrysostomos [Mon, 15 Jul 2013 07:05:57 +0000 (00:05 -0700)]
Make set-magic handle vstrings properly

Assigning a vstring to a tied variable would result in a plain string
in $_[1] in STORE.

Assigning a vstring to a magic deferred element would result in a
plain string in the aggregate’s actual element.

When magic is invoked, the magic flags are temporarily turned off on
the sv so that recursive calls to magic don’t happen.  This makes it
easier to implement functions like Perl_magic_set to read the value of
the sv without triggering get-magic.

Since vstrings are only considered vstrings when they are SvRMAGICAL,
this meant that set-magic would turn vstrings temporarily into plain
strings.  Subsequent copying (e.g., in STORE) would then fail to copy
the vstring magic.

This commit changes mg_set to leave the rmagical flag on, since it
does not affect the functionaiity of set-magic.

10 years agot/op/array.t: remove ‘no warnings "deprecated"’
Father Chrysostomos [Sun, 14 Jul 2013 00:57:46 +0000 (17:57 -0700)]
t/op/array.t: remove ‘no warnings "deprecated"’

The tests using the deprecated feature were removed in e1dccc0d34.

10 years ago[perl #117223] Remove IO::File example from perlfunc
Ed Avis [Tue, 16 Jul 2013 01:17:34 +0000 (11:17 +1000)]
[perl #117223] Remove IO::File example from perlfunc

updated to apply to blead, minor spelling and word wrap fixes by Tony
Cook.

10 years agoParseXS: generate deterministically ordered output
Karl Williamson [Mon, 15 Jul 2013 15:55:40 +0000 (09:55 -0600)]
ParseXS: generate deterministically ordered output

The generated XS file output was varying between builds because of hash
randomisation.  This sorts the output to make it the same for the same
inputs.  This facilitates eyeballing diffs of two workspaces.

10 years agoExtUtils::Embed::canon needs to *globally* substitute / for $as
Nicholas Clark [Mon, 15 Jul 2013 14:58:08 +0000 (16:58 +0200)]
ExtUtils::Embed::canon needs to *globally* substitute / for $as

Otherwise the results are buggy for package names with two or more separators.
This bug broke a -Uusedl build, once ExtUtils::Embed was refactored to use
the existing but always-buggy functionality.

10 years agoThreading 5.005 style is no longer supported
H.Merijn Brand [Mon, 15 Jul 2013 13:53:49 +0000 (15:53 +0200)]
Threading 5.005 style is no longer supported

Modernize the explain message

10 years agoperlexperiment: Sun Studio on Linux: not experimental
Ricardo Signes [Mon, 15 Jul 2013 02:45:16 +0000 (22:45 -0400)]
perlexperiment: Sun Studio on Linux: not experimental

see <20130708133005.GA8284@cancer.codesimply.com>

10 years agoperlexperiment: the M flag is not a useful thing to point out
Ricardo Signes [Mon, 15 Jul 2013 02:44:33 +0000 (22:44 -0400)]
perlexperiment: the M flag is not a useful thing to point out

see <20130708142509.GA8504@cancer.codesimply.com>