platform/upstream/perl.git
10 years agoIncrease $mro::VERSION to 1.14
Father Chrysostomos [Sun, 25 Aug 2013 07:13:33 +0000 (00:13 -0700)]
Increase $mro::VERSION to 1.14

10 years agoIncrease $Math::BigInt::FastCalc::VERSION to 0.31
Father Chrysostomos [Sun, 25 Aug 2013 07:11:34 +0000 (00:11 -0700)]
Increase $Math::BigInt::FastCalc::VERSION to 0.31

10 years agoIncrease $Data::Dumper::VERSION to 2.149
Father Chrysostomos [Sun, 25 Aug 2013 07:10:16 +0000 (00:10 -0700)]
Increase $Data::Dumper::VERSION to 2.149

10 years agoStifle diag.t
Father Chrysostomos [Sun, 25 Aug 2013 06:45:46 +0000 (23:45 -0700)]
Stifle diag.t

Maybe we should extend it at some point to run things through
splain and see whether there is a match.

10 years agoUse SSize_t for arrays
Father Chrysostomos [Sun, 25 Aug 2013 07:08:21 +0000 (00:08 -0700)]
Use SSize_t for arrays

Make the array interface 64-bit safe by using SSize_t instead of I32
for array indices.

This is based on a patch by Chip Salzenberg.

This completes what the previous commit began when it changed
av_extend.

10 years agoCroak when range tries to extend stack too far
Father Chrysostomos [Sun, 25 Aug 2013 05:51:40 +0000 (22:51 -0700)]
Croak when range tries to extend stack too far

This fixes the rest of ticket #119161.

The range operator uses IVs internally to hold the current value for
integer ranges.  It already checks that the arguments are within the
IV range and croaks otherwise.  However, on 32-bit platforms with
64-bit integers, the different between the range’s endpoints can
exceed the maximum allowed memory allocation.  This resulted in a
crash for 1..2**31, because EXTEND was passed a value which, when
cast to SSize_t, became -1, resulting in no reallocation.  Then
pp_flop proceeded to write past the end of the stack.

No tests are included in this commit, as 1..2**31 could give three
different results depending on the platform.

10 years agoUse SSize_t when extending the stack
Father Chrysostomos [Sun, 25 Aug 2013 02:09:59 +0000 (19:09 -0700)]
Use SSize_t when extending the stack

(I am referring to what is usually known simply as The Stack.)

This partially fixes #119161.

By casting the argument to int, we can end up truncating/wrapping
it on 64-bit systems, so EXTEND(SP, 2147483648) translates into
EXTEND(SP, -1), which does not extend the stack at all.  Then writing
to the stack in code like ()=1..1000000000000 goes past the end of
allocated memory and crashes.

I can’t really write a test for this, since instead of crashing it
will use more memory than I have available (and then I’ll start for-
getting things).

10 years agoUse SSize_t for tmps stack offsets
Father Chrysostomos [Sun, 25 Aug 2013 01:02:09 +0000 (18:02 -0700)]
Use SSize_t for tmps stack offsets

This is a partial fix for #119161.

On 64-bit platforms, I32 is too small to hold offsets into a stack
that can grow larger than I32_MAX.  What happens is the offsets can
wrap so we end up referencing and modifying elements with negative
indices, corrupting memory, and causing crashes.

With this commit, ()=1..1000000000000 stops crashing immediately.
Instead, it gobbles up all your memory first, and then, if your com-
puter still survives, crashes.  The second crash happesn bcause of
a similar bug with the argument stack, which the next commit will
take care of.

10 years agoinstall useful Regexp::CARP_TRACE from Carp
Zefram [Sun, 25 Aug 2013 11:23:19 +0000 (12:23 +0100)]
install useful Regexp::CARP_TRACE from Carp

Regexp is a built-in class for which no module is normally loaded, so it
can't provide its own CARP_TRACE method.  Carp must therefore supply it.
The method formats a regexp reference as a qr() expression as much as
possible.  Like string arg formatting, it uses \x{} escapes for literal
characters that are not ASCII printable, and it truncates according
to $Carp::MaxArgLen.  The truncation happens at a different stage of
processing from its position in string arg formatting, because regexp
stringification presents an already-partly-escaped form of the regexp.

10 years agoremove stray debugging print statements
Zefram [Sun, 25 Aug 2013 10:45:48 +0000 (11:45 +0100)]
remove stray debugging print statements

Debugging code was left in the version of Carp's string arg formatting
that handles upgraded strings on older perls.

10 years agomore tests for $Carp::MaxArgLen
Zefram [Sun, 25 Aug 2013 10:28:27 +0000 (11:28 +0100)]
more tests for $Carp::MaxArgLen

10 years agoperlexperiment: Unicode on EBCDIC is not backtracking
Ricardo Signes [Sun, 25 Aug 2013 02:50:29 +0000 (22:50 -0400)]
perlexperiment: Unicode on EBCDIC is not backtracking

10 years agoperlexperiment: ticket for pluggable keywords
Ricardo Signes [Sun, 25 Aug 2013 02:23:24 +0000 (22:23 -0400)]
perlexperiment: ticket for pluggable keywords

10 years agoperlexperiment: ticket for :win32 pseudolayer
Ricardo Signes [Sun, 25 Aug 2013 02:09:22 +0000 (22:09 -0400)]
perlexperiment: ticket for :win32 pseudolayer

10 years agoperlexperiment: ticket link for regex_sets
Ricardo Signes [Sun, 25 Aug 2013 01:52:35 +0000 (21:52 -0400)]
perlexperiment: ticket link for regex_sets

10 years agorelease schedule: the rest of 2013 (except September!)
Ricardo Signes [Sun, 25 Aug 2013 01:36:38 +0000 (21:36 -0400)]
release schedule: the rest of 2013 (except September!)

10 years agorelease schedule: 5.18.1 is out and 5.14.x is EOL
Ricardo Signes [Sun, 25 Aug 2013 01:31:02 +0000 (21:31 -0400)]
release schedule: 5.18.1 is out and 5.14.x is EOL

10 years agoupdate copyright years for Carp dual-life release
Zefram [Sat, 24 Aug 2013 19:30:09 +0000 (20:30 +0100)]
update copyright years for Carp dual-life release

10 years agoupdate autodie test for new Carp stack trace form
Zefram [Sat, 24 Aug 2013 18:10:31 +0000 (19:10 +0100)]
update autodie test for new Carp stack trace form

10 years agoconsistently escape args in Carp stack trace
Zefram [Sat, 24 Aug 2013 17:00:36 +0000 (18:00 +0100)]
consistently escape args in Carp stack trace

Previously, an upgraded string argument would be wrapped in quote
characters but have all of its characters represented literally in
the stack trace, including control characters.  Also, the escaping of
unprintable characters for downgraded string arguments wasn't consistent
with Perl syntax: it used \x{} escapes inside single quotes.

The new way is that string arguments (except those that look numeric)
are represented as double-quoted strings, using correct Perl syntax.
Characters outside the ASCII printable range always get \x{} escaping,
whether the string is upgraded or downgraded.  ASCII printables that
require backslash escaping get it.  Where an argument is truncated
due to length, the added ellipsis appears outside the double quotes,
to avoid ambiguity with a string that contains actual dots.

Implementing this is complicated by problems with applying regexps to
upgraded strings, which are particularly a problem in the constrained
environment in which Carp must run.  This has previously inhibited us
from implementing correct handling of upgraded strings.  The problems
were all resolved in Perl 5.13.11, so from there on we can just use the
simple regexp implementation.  On older Perls upgraded strings now get
the same treatment, but implemented in a less efficient manner that does
not use regexps.

Non-string arguments, most notably references, are now are not represented
as quoted strings.  The overload::StrVal() representation is safely
distinct from other argument representations.  This in particular allows
distinguishing between an argument that is a reference and an argument
that is the result of stringifying a reference.

10 years agoFor SDBM_File, stop EU::MM from generating its default subdirs rule.
Nicholas Clark [Thu, 22 Aug 2013 09:48:29 +0000 (11:48 +0200)]
For SDBM_File, stop EU::MM from generating its default subdirs rule.

The default subdirs rule creates a race condition with the rule that
Makefile.PL explicitly adds to generate libsdbm.a, which can cause parallel
makes to fail.

10 years agoDon’t give unavailability warnings about our vars
Father Chrysostomos [Sat, 24 Aug 2013 12:54:23 +0000 (05:54 -0700)]
Don’t give unavailability warnings about our vars

Commit ce0d59fdd1c started using NULL to indicate nonexistent array
elements.  Since pads are AVs, they are filled with NULLs initially,
rather than &PL_sv_undef.

For ‘our’ vars, the pad entry is never actually touched.  Only one
piece of code was inspecting it, namely S_cv_clone_pad.  &PL_sv_undef
just happens to pass the checks that make sure the var is not stale.
However, we really should not be checking that at all if this is an
‘our’ var.

Even if we change ‘our’ vars back to having a &PL_sv_undef pad
entry, this fix should stay, as it makes the code clearer and makes
S_cv_clone_pad more robust.

10 years agopodcheck.t: Skip perl5200delta
Father Chrysostomos [Sat, 24 Aug 2013 01:26:47 +0000 (18:26 -0700)]
podcheck.t: Skip perl5200delta

I would have to change the header to something other than
‘perldelta’, even though that is what the final document
will have.

I would also have to start adding modules to the known modules
list which will not have to be there in the final release.

That is more work than necessary, so just skip this file for now.

10 years agoAdd perl5200delta to MANIFEST
Father Chrysostomos [Sat, 24 Aug 2013 01:18:36 +0000 (18:18 -0700)]
Add perl5200delta to MANIFEST

10 years agoList broken modules from #119125 in perl5200delta
Father Chrysostomos [Sat, 24 Aug 2013 01:11:55 +0000 (18:11 -0700)]
List broken modules from #119125 in perl5200delta

so that we can track these all in one spot and close the various RT
tickets as we go.

I am only listing ‘high-profile’ modules, meaning those that have
at least 5 dependents (an arbitrary number picked by Jesse Vincent
some time ago).

10 years agoStart perl5200delta
Father Chrysostomos [Sat, 24 Aug 2013 01:08:31 +0000 (18:08 -0700)]
Start perl5200delta

just the template for now

10 years agoavoid package name "B" in Carp tests
Zefram [Fri, 23 Aug 2013 22:11:30 +0000 (23:11 +0100)]
avoid package name "B" in Carp tests

[rt.cpan.org #76167]  For tests not relating to the B module, avoid using
"B" as a package name.

10 years agoregularise test for Carp vivifying B stash
Zefram [Fri, 23 Aug 2013 21:58:41 +0000 (22:58 +0100)]
regularise test for Carp vivifying B stash

There's an old test to check that Carp doesn't vivify B:: despite
attempting to use B::svref_2object().  Turn this into the same kind of
test now used for overload::StrVal() and utf8::downgrade(), testing more
cleanly for stash vivification and also testing for GV vivification.

10 years agoPATCH: [perl #119443] Blead won't compile on wince
Karl Williamson [Fri, 23 Aug 2013 19:38:03 +0000 (13:38 -0600)]
PATCH: [perl #119443] Blead won't compile on wince

This commit adds #if's to cause locale handling code to compile on
platforms that don't have full-featured locale handling.  The commits
mentioned in the ticket did not adequately cover these situations.

10 years agoregcomp.c: Silence compiler warning
Karl Williamson [Thu, 22 Aug 2013 17:17:20 +0000 (11:17 -0600)]
regcomp.c: Silence compiler warning

This call to regclass_swash() is not using its return value, so don't
store it in a variable that is otherwise unused, which causes some
compilers to complain.

10 years agoCarp: paranoid sub lookup
Father Chrysostomos [Fri, 23 Aug 2013 07:50:40 +0000 (00:50 -0700)]
Carp: paranoid sub lookup

Carp avoids autovivifying stashes when seeing whether a sub like
utf8::is_utf8 or overload::StrVal exists.

Its logic was slightly faulty, in that it did not take into account
that the existence of $::{"utf8::"} does not indicate the presence
of a typeglob in that element.  It could have been created due to
autovivification.  It also failed to take into account that $utf8::’s
HASH slot might be empty.  This would result in death.

In fixing this, I moved the common logic into a single function
and also took the opportunity to avoid multiple hash lookups in
a row.

10 years agoregen pod issues
Father Chrysostomos [Fri, 23 Aug 2013 07:03:11 +0000 (00:03 -0700)]
regen pod issues

10 years agoFix some long lines in BigInt.pm
Father Chrysostomos [Fri, 23 Aug 2013 06:57:41 +0000 (23:57 -0700)]
Fix some long lines in BigInt.pm

10 years agoLong verbatim pod lines in BigFloat.pm
Father Chrysostomos [Fri, 23 Aug 2013 06:37:44 +0000 (23:37 -0700)]
Long verbatim pod lines in BigFloat.pm

10 years agotoke.c: Merge some mad and sane code
Father Chrysostomos [Fri, 23 Aug 2013 06:06:30 +0000 (23:06 -0700)]
toke.c: Merge some mad and sane code

These two code paths are now nearly identical.  However, one uses s as
its cursor; the other uses d therefor while using s to remember the
previous position.  If we switch the uses of d and s, then outside of
PL_madskills we don’t even need to set d.

10 years agotoke.c: Remove commented-out code
Father Chrysostomos [Fri, 23 Aug 2013 05:35:28 +0000 (22:35 -0700)]
toke.c: Remove commented-out code

This ‘if(){’ has been commented out since it was added in 5db068806.
Presumably the intent was to make the special mad code specific to
PL_madskills at some point and have mad builds running without
PL_madskills follow the same code as regular builds (the *s = '\0' and
PL_bufend assignments).

Since then, though, the standard code has changed to match the mad
code.  The next commit will merge them.

10 years agoFix typo in bf1b738b; another line num bug
Father Chrysostomos [Fri, 23 Aug 2013 05:58:37 +0000 (22:58 -0700)]
Fix typo in bf1b738b; another line num bug

This affects only mad builds.  The line number after

nullary_keyword_such_as_time
;

was off by one.

10 years ago[perl #119429] restore XS module building on WinCE
Tony Cook [Fri, 23 Aug 2013 06:32:08 +0000 (16:32 +1000)]
[perl #119429] restore XS module building on WinCE

The Makefile.ce PV change was split off into an update of
bump-perl-version

10 years agorestore XS module building for WinCE
Daniel Dragan [Thu, 22 Aug 2013 18:11:17 +0000 (14:11 -0400)]
restore XS module building for WinCE

configpm
- when debugging configpm, Config.pm is already loaded, so the alternate
  Config.pm for CE isn't loaded, warn about the problem and delete the
  native Config.pm to allow the cross Config.pm to be loaded

win32/Makefile.cd
- better build product cleanup, copy from the win32 makefile
- disable a bunch of module that dont/dont yet build on CE
- debugging configpm required a shortcut to make it easier to run in
  isolation
- fix the defines that wind up in the cross Config.pm
- add -GS- to disable the MS Security Cookie feature on MSVC for ARM >=14
  compilers, this stops a .lib linking error, security cookie overhead
  isnt needed for a very space limited device

sdsdkenv.bat is the file I use to set env vars to compile for WM since
starting in SmartDevices SDK, there is no equivelent of vcvarsall.bat
for makefile building, there was a vcvarsall.bat equivelent in EVC4 tho

MSVC for non Intel CPUs sometimes isn't named cl.exe, fix config_sh.PL to
deal with it

how to compile CE Perl, some steps involving celib and MS SDKs not included
and 2 patches to CPAN modules, Socket and MakeMaker, are not in this commit
but they are required to build CE Perl

-in a Win32 x86/x64 command prompt do a "nmake all" to make a Desktop Perl
-then in a WinCE build env command prompt do a "nmake -f makefile.ce all"
-/xlib will have all your XS DLLs and PM files, /win32/$(MACHINE) will
 have perl519.dll and perl.exe

Tony Cook: update MANIFEST

10 years ago[perl #119429] bump-perl-version now updates Makefile.ce
Tony Cook [Fri, 23 Aug 2013 05:50:54 +0000 (15:50 +1000)]
[perl #119429] bump-perl-version now updates Makefile.ce

10 years ago[perl #118931] Fix line number bug
Father Chrysostomos [Thu, 22 Aug 2013 17:01:58 +0000 (10:01 -0700)]
[perl #118931] Fix line number bug

Commit 2179133 (in 5.19.2) introduced this line number bug when it
modified the parser to look past newlines when searching for => after
a keyword:

$ perl5.19.3
1 unless
1;
warn;
^D
Warning: something's wrong at - line 2.

The warning should say line 3, not 2.

Before 2179133, the parser’s line-reading algorithm work strictly in
two modes:  From a file, one line would be read into PL_linestr at a
time.  In a string eval, PL_linestr would contain all the code.

To be able to look past a newline to find => after a keyword, the
parser’s former mode had to be adjusted:

• It has to be possible to append more lines of input to the buffer
  without incrementing the line number.
• When reading from a filehandle, the lexer should not assume when it
  sees "\n" that it has reached the end of the buffer.

Commit 2179133 did those two things.

It did not, however, make the lexer increment the line number when
encountering a newline in the middle of it (when reading from a han-
dle; string eval follows a different code path).

Fixing it to do that requires that lex_start be adjusted, too.  When
lexing begins, PL_linestr is set to "\n;" when there is no string to
eval.  This worked for file handles because the lexer, on seeing the
\n, would ignore the semicolon.

Now that it no longer ignores the semicolon, it will end up incre-
mented the line number erroneously at the outset, so set the buffer
to just "\n" instead.

In one place (skipspace2), the mad-specific code was setting PL_bufptr
to point at its previous location after calling skipspace.  skipspace
sets it to point after the newline to prevent incline() from being
called a second time for the same newline.  But this is exactly what
happens if skipspace2 resets PL_bufptr.  The callers of skipspace2
apparently don’t depend on this, so we can remove it.

10 years agoperlexperiment: add ticket link for autoderef
Ricardo Signes [Fri, 23 Aug 2013 01:49:42 +0000 (21:49 -0400)]
perlexperiment: add ticket link for autoderef

10 years agoperldelta for 5ceca735, 6358232b
Tony Cook [Fri, 23 Aug 2013 01:26:58 +0000 (11:26 +1000)]
perldelta for 5ceca7356358232b

10 years agoAdd bint() method for rounding towards zero.
Peter John Acklam [Thu, 15 Aug 2013 04:13:17 +0000 (14:13 +1000)]
Add bint() method for rounding towards zero.

Since bfloor() and bceil() exist, add bint() for completeness.  As with
bfloor() and bceil(), bint() does not change the object class. This is
unlike as_int(), which converts the object to a Math::BigInt.

Rename bint() subroutine in the example section to bigint() to avoid
confusion with the new method bint().

Add tests for bint().

Add a little more precise documentation of bfloor() and bceil().

10 years agobump versions for Math::BigInt and Math::BigFloat
Tony Cook [Fri, 23 Aug 2013 00:58:43 +0000 (10:58 +1000)]
bump versions for Math::BigInt and Math::BigFloat

10 years agoClean up POD for Math::BigInt and Math::BigFloat
Tony Cook [Fri, 23 Aug 2013 00:34:09 +0000 (10:34 +1000)]
Clean up POD for Math::BigInt and Math::BigFloat

Based on work done by Peter John Acklam, differences from his original
patch:

- links to items (which have been corrected by others) have been retained

- unnecessary conversion of < and > to E<lt> and E<gt> has been skipped.

- =over N has been converted to =over

- adjusted white-space in many places to avoid hitting column 80 in
  perldoc for verbatim text

10 years agodetect Carp/Carp::Heavy version mismatch
Zefram [Thu, 22 Aug 2013 21:57:01 +0000 (22:57 +0100)]
detect Carp/Carp::Heavy version mismatch

[rt.cpan.org #79649]  If an old Carp, requiring old-style Carp::Heavy
that provides subroutines, gets a newer stub-style Carp::Heavy, due to
@INC having changed, the resulting error messages were not awesome.

10 years agoavoid more vivification in Carp
Zefram [Thu, 22 Aug 2013 21:29:08 +0000 (22:29 +0100)]
avoid more vivification in Carp

Avoid vivifying the overload::StrVal subroutine, its glob, or its stash.
This is done in the same way as the existing avoidance of vivification of
utf8::is_utf8 and utf8::downgrade.  However, the check has to be made at
runtime, whereas the utf8-related ones are checked at load time, because
the utf8 ones are built into the perl core (only absent pre perl 5.8)
but overload is a separate module that can be loaded later.

10 years agoSkip dynaloader test on Bitrig like we do for OpenBSD
Chris 'BinGOs' Williams [Thu, 22 Aug 2013 18:04:47 +0000 (19:04 +0100)]
Skip dynaloader test on Bitrig like we do for OpenBSD

10 years agoUpdate perldelta for Bitrig platform support
Chris 'BinGOs' Williams [Thu, 22 Aug 2013 16:08:33 +0000 (17:08 +0100)]
Update perldelta for Bitrig platform support

10 years agoAdd Marco Peereboom and Owain G. Ainsworth to AUTHORS
Chris 'BinGOs' Williams [Thu, 22 Aug 2013 15:15:14 +0000 (16:15 +0100)]
Add Marco Peereboom and Owain G. Ainsworth to AUTHORS

10 years agoApply bitrig change to lib/locale.t too
Chris 'BinGOs' Williams [Thu, 22 Aug 2013 15:11:29 +0000 (16:11 +0100)]
Apply bitrig change to lib/locale.t too

This change appears to have entered the bitrig source tree via
openbsd source merge.

10 years agoTweak the perl build some
Owain G. Ainsworth [Thu, 22 Aug 2013 14:55:02 +0000 (15:55 +0100)]
Tweak the perl build some

Fix the cross makefile.  makefile.SH treat us like openbsd.

hints/bitrig.sh: remove all version number detection goop. this is for
openbsd versions that are currently *higher* then the bitrig version
number, so avoid foot shooting by throwing it out.

Signed-off-by: Chris 'BinGOs' Williams <chris@bingosnet.co.uk>
10 years agoAdd support for Bitrig BSD
Marco Peereboom [Thu, 22 Aug 2013 14:41:42 +0000 (15:41 +0100)]
Add support for Bitrig BSD

Signed-off-by: Chris 'BinGOs' Williams <chris@bingosnet.co.uk>
10 years agoFix Peek.t failure under -DPERL_NO_COW
Father Chrysostomos [Thu, 22 Aug 2013 15:32:11 +0000 (08:32 -0700)]
Fix Peek.t failure under -DPERL_NO_COW

The code for stripping out COW_REFCNT needs to be more lenient
and allow things like COW_REFCNT = [12].

10 years ago[perl #118747] Allow in-place s///g when !!PL_sawampersand
Father Chrysostomos [Thu, 22 Aug 2013 04:59:20 +0000 (21:59 -0700)]
[perl #118747] Allow in-place s///g when !!PL_sawampersand

This is the more correct version of 1555b325 which was reverted
by 6200d5a0e.

In pp_subst, there is an initial pattern match against the target
string, followed by logic to determine which of several code paths
will handle the rest of the substitution, depending on which shortcuts
can be taken.

There is one path specifically for doing a global sort (/g) and modi-
fying the target in place.  This code was skipped if the target was a
copy-on-write scalar or if the pre-match copy was enabled.  The pre-
match copy is always enabled now, so this code is unreachable.

In-place substitution stringifies the rhs at the outset, just after
the first regexp match, but before any substitution.  Then it uses
that string buffer, expecting it not to change.

That clearly cannot work with s/a/$&/g; it will also cause erratic
behaviour in the case of regexp code blocks (which will see the
string being modified, which doesn not happen with unoptimised subst).
That’s why the in-place optimisation has to be skipped when the
REXEC_COPY_STR flag is set.

But we can tweak that logic:

• As long as the rhs is not a magical var, its contents are not going
  to change from one iteration to the next.
• If there are no code blocks, nothing will see the string during the
  substitution.

So this commit adds logic to check those things, enabling this opti-
misation where possible.

Skipping this optimisation for the pre-match copy was originally added
in commit 5d5aaa5e7.

10 years agoRemove null check from mg.c:magic_getvec
Father Chrysostomos [Fri, 26 Jul 2013 13:25:36 +0000 (06:25 -0700)]
Remove null check from mg.c:magic_getvec

lsv can never be null here.  This null check has been here since
vec’s get-magic was added in ae389c8a or 6ff81951f7.

10 years agoFix assertion failure with $#a=\1
Father Chrysostomos [Fri, 26 Jul 2013 06:09:58 +0000 (23:09 -0700)]
Fix assertion failure with $#a=\1

If the array has been freed and a reference is then assigned to
the arylen scalar and then get-magic is called on that scalar,
Perl_magic_getarylen misbehaves.  SvOK_off is not sufficient if
arbitrary values can be assigned by Perl code.  Globs, refs and
regexps (among others) need special handling, which sv_setsv
knows how to do.

10 years agoSkip the perldoc test if 'man' is missing
Niko Tyni [Tue, 6 Aug 2013 13:57:00 +0000 (16:57 +0300)]
Skip the perldoc test if 'man' is missing

This fixes a test failure in minimal build environments without
a 'man' command.

10 years agoUpgrade Perl::OSType from 1.003 to 1.004
Steve Hay [Thu, 22 Aug 2013 07:41:38 +0000 (08:41 +0100)]
Upgrade Perl::OSType from 1.003 to 1.004

10 years agoUpgrade Module-Metadata from 1.000014 to 1.000016
Steve Hay [Thu, 22 Aug 2013 07:38:20 +0000 (08:38 +0100)]
Upgrade Module-Metadata from 1.000014 to 1.000016

10 years agoRevert "[perl #118747] Allow in-place s///g when !!PL_sawampersand"
Father Chrysostomos [Thu, 22 Aug 2013 08:15:03 +0000 (01:15 -0700)]
Revert "[perl #118747] Allow in-place s///g when !!PL_sawampersand"

This reverts commit 1555b325296e46f7b95bee03fe856cec348b0d57.

This is causing test failures (not on my machine), and I do not have
time right now to track them all down.

10 years agopp_hot.c:pp_subst: Move comment
Father Chrysostomos [Thu, 22 Aug 2013 05:03:49 +0000 (22:03 -0700)]
pp_hot.c:pp_subst: Move comment

Perl 5 has always had the ‘don't match same null twice’ comment
in pp_subst.  Originally it was a parenthetical note right below
the s == m.

71be2cbc removed the parentheses.  Commit f722798be moved it further
away from s == m.  Now what it refers to is far from clear.

10 years ago[perl #118747] Allow in-place s///g when !!PL_sawampersand
Father Chrysostomos [Thu, 22 Aug 2013 04:59:20 +0000 (21:59 -0700)]
[perl #118747] Allow in-place s///g when !!PL_sawampersand

In pp_subst, there is an initial pattern match against the target
string, followed by logic to determine which of several code paths
will handle the rest of the substitution, depending on which shortcuts
can be taken.

There is one path specifically for doing a global sort (/g) and modi-
fying the target in place.  This code was skipped if the target was a
copy-on-write scalar or if the pre-match copy was enabled.  The pre-
match copy is always enabled now, so this code is unreachable.

There does not appear to be any reason why this path must be skipped
in the presence of the pre-match copy.  The string gets copied by the
initial regexp match and $& and friends point there afterwards.

This skip was added in commit 5d5aaa5e7 (a jumbo patch, so good luck
figuring it out).  This commit removes the skip, and all tests pass.

This, of course, only affects those cases where copy-on-write does
not kick in; for instance, when the string’s length is one less than
its buffer:

$  ./perl -Ilib -e 'use Devel::Peek; $x = " "; $x .= " "x22; Dump $x; $x =~ s/ /b/g; Dump $x'
SV = PV(0x7ffb0b807098) at 0x7ffb0b82eed8
  REFCNT = 1
  FLAGS = (POK,pPOK)
  PV = 0x7ffb0b4066b8 "                       "\0
  CUR = 23
  LEN = 24
SV = PV(0x7ffb0b807098) at 0x7ffb0b82eed8
  REFCNT = 1
  FLAGS = (POK,pPOK)
  PV = 0x7ffb0b4066b8 "bbbbbbbbbbbbbbbbbbbbbbb"\0
  CUR = 23
  LEN = 24

10 years agoMath-BigInt-FastCalc: Swap out base for parent (bowtie)
kevin dawson [Wed, 21 Aug 2013 14:22:20 +0000 (15:22 +0100)]
Math-BigInt-FastCalc: Swap out base for parent (bowtie)

For: RT #119405

10 years agoLocale-Maketext: Swap out base for parent (bowtie)
kevin dawson [Wed, 21 Aug 2013 12:23:59 +0000 (13:23 +0100)]
Locale-Maketext: Swap out base for parent (bowtie)

For: RT #119403

10 years agoAttribute-Handlers: Swap out base for parent in test files.
kevin dawson [Mon, 19 Aug 2013 15:57:41 +0000 (16:57 +0100)]
Attribute-Handlers: Swap out base for parent in test files.

Committer's note: Add dist/Attribute-Handlers/demo/MyClass.pm to list of
files whose $VERSION numbers do not have to be incremented when modified.
Since this file is found in a 'demo/' directory, it does not have to be
treated as if it were a real Perl library which happens to be shipping
with core.

For: RT #119365

10 years agoconsistent POD itemisation markup
Zefram [Wed, 21 Aug 2013 22:53:13 +0000 (23:53 +0100)]
consistent POD itemisation markup

10 years agoavoid Unicode warnings in Carp
Zefram [Wed, 21 Aug 2013 22:43:20 +0000 (23:43 +0100)]
avoid Unicode warnings in Carp

Only affects operation on old Perl versions.  Some special-case hackery
required for compatibility with old warnings.pm that eagerly loads Carp.

10 years agoRMG: Fix some verbatim lines over 79 columns
Karl Williamson [Wed, 21 Aug 2013 21:33:52 +0000 (15:33 -0600)]
RMG: Fix some verbatim lines over 79 columns

10 years agoCorrect spelling of LC_MESSAGES
Niko Tyni [Wed, 21 Aug 2013 20:38:29 +0000 (14:38 -0600)]
Correct spelling of LC_MESSAGES

10 years agoSkip tests for dl_unload_file() when built with -DPERL_GLOBAL_STRUCT_PRIVATE
Nicholas Clark [Wed, 21 Aug 2013 19:05:51 +0000 (21:05 +0200)]
Skip tests for dl_unload_file() when built with -DPERL_GLOBAL_STRUCT_PRIVATE

Building with -DPERL_GLOBAL_STRUCT_PRIVATE uses alternative implementations
of Perl_my_cxt_init() and Perl_my_cxt_index() which store the pointer to the
extension name. For a dynamically loaded shared object this is a pointer to
memory which will be released if that shared object is unloaded, meaning that
any *other* module which calls Perl_my_cxt_index() will likely attempt a read
of unmapped memory.

10 years agoWhitespace changes to DynaLoader.t, as part of adding a TODO: block.
Nicholas Clark [Wed, 21 Aug 2013 18:59:28 +0000 (20:59 +0200)]
Whitespace changes to DynaLoader.t, as part of adding a TODO: block.

10 years agoDocument that DynaLoader::dl_unload_file() is not called at exit by default.
Nicholas Clark [Wed, 21 Aug 2013 18:51:15 +0000 (20:51 +0200)]
Document that DynaLoader::dl_unload_file() is not called at exit by default.

DynaLoader::dl_unload_file() is only called automatically to unload all
loaded shared objects if the perl interpreter was built with the C macro
DL_UNLOAD_ALL_AT_EXIT defined. The documentation has been incorrectly
stating that it is always called since dl_unload_file() was added in v5.6.0

When dl_unload_file() was first added by commit abb9e9dca5a5f121 (March 1st,
2000), it was always called at exit, if available. It was made conditional on
DL_UNLOAD_ALL_AT_EXIT being defined by commit 23d2500b2b45b1be (March 20th,
2000), but the documentation was never updated to reflect this. v5.6.0 was
release on March 22nd, 2000.

10 years agoUpdate RMG to fill in steps on preparing M::CL for the next blead release
Steve Hay [Wed, 21 Aug 2013 13:09:55 +0000 (14:09 +0100)]
Update RMG to fill in steps on preparing M::CL for the next blead release

There is one XXX item here: Porting/corelist.pl doesn't update
dist/Module-CoreList/lib/Module/CoreList/Utils.pm.

10 years agoPrepare Module::CoreList for 5.19.4 and bump its $VERSION
Steve Hay [Wed, 21 Aug 2013 12:29:01 +0000 (13:29 +0100)]
Prepare Module::CoreList for 5.19.4 and bump its $VERSION

10 years agoModule::CoreList 2.97 is now on CPAN
Steve Hay [Wed, 21 Aug 2013 11:39:09 +0000 (12:39 +0100)]
Module::CoreList 2.97 is now on CPAN

10 years ago[perl #118691] Allow defelem magic with neg indices
Father Chrysostomos [Wed, 17 Jul 2013 05:56:44 +0000 (22:56 -0700)]
[perl #118691] Allow defelem magic with neg indices

When a nonexistent array element is passed to a subroutine, a special
‘deferred element’ scalar (implemented using something called defelem
magic) is passed to the subroutine instead, which delegates to the
array element.  This allows some_benign_function($array[$nonexistent])
to avoid autovivifying unnecessarily.

Whether this magic would be triggered was based on whether the element
was within the range 0..$#array.  Since arrays can contain nonexistent
elements before $#array, this logic is incorrect.  It also makes sense
to allow $array[$neg] where the negative number points before the
beginning of the array to create a deferred element and only croak if
it is assigned to.

This commit fixes the logic for when deferred elements are created
and implements these deferred negative elements.

Since we have to be able to store negative values in xlv_targoff, it
is convenient to make it a union (with two types--signed and unsigned)
and use LvSTARGOFF for defelem array indices.

10 years agoperldelta for 710639c2
Tony Cook [Wed, 21 Aug 2013 05:37:44 +0000 (15:37 +1000)]
perldelta for 710639c2

10 years ago[perl #113054] add tests for find2perl and fix ? wildcard handling
Tony Cook [Wed, 21 Aug 2013 05:30:56 +0000 (15:30 +1000)]
[perl #113054] add tests for find2perl and fix ? wildcard handling

10 years agoarray.t: Tests for #7508 and #109726
Father Chrysostomos [Wed, 21 Aug 2013 05:26:34 +0000 (22:26 -0700)]
array.t: Tests for #7508 and #109726

10 years ago[perl #113054] find2perl mistranslates fileglob ? to regex .?
Tony Cook [Wed, 14 Aug 2013 02:17:31 +0000 (12:17 +1000)]
[perl #113054] find2perl mistranslates fileglob ? to regex .?

fix and un-TODO the test

10 years ago[perl #113054] test find2perl, with a TODO for ? glob handling
Tony Cook [Wed, 14 Aug 2013 02:15:40 +0000 (12:15 +1000)]
[perl #113054] test find2perl, with a TODO for ? glob handling

10 years agoAlphabetise AUTHORS
Father Chrysostomos [Wed, 21 Aug 2013 03:39:58 +0000 (20:39 -0700)]
Alphabetise AUTHORS

I know, ‘Whose alphabetisation?’

10 years agoIncrease $Devel::Peek::VERSION to 1.14
Father Chrysostomos [Wed, 21 Aug 2013 03:39:06 +0000 (20:39 -0700)]
Increase $Devel::Peek::VERSION to 1.14

10 years agoIncrease $IPC::Open3::VERSION to 1.16
Father Chrysostomos [Wed, 21 Aug 2013 03:38:47 +0000 (20:38 -0700)]
Increase $IPC::Open3::VERSION to 1.16

10 years agoIncrease $Storable::VERSION to 2.47
Father Chrysostomos [Wed, 21 Aug 2013 03:38:08 +0000 (20:38 -0700)]
Increase $Storable::VERSION to 2.47

10 years ago[perl #7508] Use NULL for nonexistent array elems
Father Chrysostomos [Tue, 2 Jul 2013 20:07:45 +0000 (13:07 -0700)]
[perl #7508] Use NULL for nonexistent array elems

This commit fixes bug #7508 and provides the groundwork for fixing
several other bugs.

Elements of @_ are aliased to the arguments, so that \$_[0] within
sub foo will reference the same scalar as \$x if the sub is called
as foo($x).

&PL_sv_undef (the global read-only undef scalar returned by the
‘undef’ operator itself) was being used to represent nonexistent
array elements.  So the pattern would be broken for foo(undef), where
\$_[0] would vivify a new $_[0] element, treating it as having been
nonexistent.

This also causes other problems with constants under ithreads
(#105906) and causes a pending fix for another bug (#118691) to trig-
ger this bug.

This commit changes the internals to use a null pointer to represent a
nonexistent element.

This requires that Storable be changed to account for it.  Also,
IPC::Open3 was relying on the bug.  So this commit patches
both modules.

10 years agoMove super cache into mro meta
Father Chrysostomos [Sun, 18 Aug 2013 07:36:05 +0000 (00:36 -0700)]
Move super cache into mro meta

Iterated hashes shouldn’t have to allocate space for something
specific to stashes, so move the SUPER method cache from the
HvAUX struct (which all iterated hashes have) into the mro
meta struct (which only stashes have).

10 years agoadd perl5181delta
Father Chrysostomos [Wed, 21 Aug 2013 01:05:57 +0000 (18:05 -0700)]
add perl5181delta

10 years ago[perl #118753] Remove erroneous elsif("") warning
Father Chrysostomos [Tue, 20 Aug 2013 20:21:14 +0000 (13:21 -0700)]
[perl #118753] Remove erroneous elsif("") warning

‘5 || foo’ gets optimised down to a plain ‘5’.  If that happens in
void context, we should not get a warning, as constant folding is not
supposed to change behaviour.

We accomplish that by flagging the constant with
OPpCONST_SHORTCIRCUIT.  The code that warns checks for the absence of
that flag first.

Commit f6f3a1fea, in order to improve line number accuracy in elsif,
changed the condition in elsif() to have a nulled COP (containing line
numbers) with the condition as its kidop.

That prevented constant folding from happening, so commit 71c4dbc37
implemented a function (search_const) to search to find a constant
below the nulled COP, but only used it to make folding happen, and did
not use it for OPpCONST_SHORTCIRCUIT.

The result was that if($foo){}elsif(""){} (mostly equivalent to
$foo ? do{} : "" && do {} internally) got folded to $foo ? do{} : ""
without OPpCONST_SHORTCIRCUIT being set on the final "".  So the warn-
ing occurs.

This commit uses search_const to set OPpCONST_SHORTCIRCUIT, and the
warning vanishes.

10 years agothread_it.pl: Increase Mac stack
Father Chrysostomos [Tue, 20 Aug 2013 20:05:04 +0000 (13:05 -0700)]
thread_it.pl: Increase Mac stack

At Vincent’s suggestion (<5213ABBE.9080706@profvince.com>), increase
the Mac stack size to 1000000.

10 years agoFilter-Simple tests: swap out base for parent.
kevin dawson [Tue, 20 Aug 2013 19:18:38 +0000 (20:18 +0100)]
Filter-Simple tests: swap out base for parent.

kevin dawson is now an author.

For: RT #119393

10 years agoTypo fix in perlunicode
Victor [Tue, 20 Aug 2013 11:18:20 +0000 (15:18 +0400)]
Typo fix in perlunicode

characters with ordinal 0x100 cannot be downgraded, thus
all characters >= 0x100 have character semantic.

10 years agoUpdate the RMG following the release of 5.19.3
Steve Hay [Tue, 20 Aug 2013 21:54:09 +0000 (22:54 +0100)]
Update the RMG following the release of 5.19.3

Reflow a paragraph with an odd newline, update a couple of previous commit
links (but keeping one as a major update (5.18->5.19) since it contains
more edits), update mention of the variables and files involved in the
Module::CoreList update, remove an out-dated reference to makerel adding
DOS line endings (it hasn't done that since 1f9a80b25f), and clarify that
CPAN's /src/README.html only lists stable releases.

10 years agoIncrease XS::Typemap::VERSION to 0.11
Father Chrysostomos [Tue, 20 Aug 2013 08:06:53 +0000 (01:06 -0700)]
Increase XS::Typemap::VERSION to 0.11

10 years ago[perl #118693] Remove PADTMP exemption from uninit warnings
Father Chrysostomos [Mon, 19 Aug 2013 23:16:37 +0000 (16:16 -0700)]
[perl #118693] Remove PADTMP exemption from uninit warnings

This fixes a problem with undefined values return from XSUBs not pro-
ducing such warnings.

The default typemap for XSUBs uses the target of the entersub call (in
the caller’s pad) to return the converted value, instead of having to
allocate a new SV for that.

So, for example, a function returning char* will cause that char* to
be assigned to the target via sv_setpv.  Then the target is returned.

As a special case, NULL return from a char*-returning function will
produce an undef return value.  This undef return value was not trig-
gering an uninitialized warning.

All targets are marked PADTMP, and anything marked PADTMP is exempt
from uninitialized warnings in some code paths, but not others.

This goes all the way back to 91bba347, which suppressed the warning
with only a hit at why (something to do with bitwise ops warning inap-
propriately).  I think it was to make ~undef exempt.  But a1afd104
stopped it from being exempt.

Only a few pieces of code were relying on this exemption, and it was
hiding bugs, too.  The last few commits have addressed those, so kiss
this exemption good-bye!

pp_reverse had a workaround to force an uninit warning (since
1e21d011c), so remove the workaround to avoid a double uninit warning.

10 years agoAvoid double stringification in pp_complement
Father Chrysostomos [Tue, 20 Aug 2013 07:17:15 +0000 (00:17 -0700)]
Avoid double stringification in pp_complement

Commit 91bba347 made targets exempt from uninit warnings.  The com-
mit message only says it has something to do with fixing warnings on
bitwise ops.

Commit a1afd1046 worked around that by doing an extra stringifica-
tion before assigning to the target, to produce an uninit warning
on purpose.

As far as I can tell, the only purpose of 91bba347 was to avoid the
warning for ~undef.  (I haven’t actually tried building the commit
before that to confirm.)

In any case, the uninit warning has been long tested for and is now
expected behaviour.

Since I am about to remove the uninit warning exemption for targets,
stop relying on that.

This speed ups the code slightly, as we avoid a double string-
ification.

10 years agoFix skip logic in pad_tidy and cv_clone
Father Chrysostomos [Tue, 20 Aug 2013 06:17:08 +0000 (23:17 -0700)]
Fix skip logic in pad_tidy and cv_clone

Commit 325e1816dc changed the logic for determining whether a pad
entry is to be treated like a constant; i.e., shared between recursion
levels and sub clones.

According the old logic, a pad entry must be shared if it is marked
READONLY or is a shared hash key scalar.  According to the new logic,
the entry must be shared if the pad name has a zero-length PV (i.e.,
&PL_sv_no).

Two pieces of code were still following the old logic.  Changing them
fixes this old bug:

my $close_over_me;
sub  {
    () = $close_over_me;
    open my $fh, "/dev/null";
    print "$$fh\n"
}->();
__END__

Output:
*main::

The name attached to the implicit rv2gv op in open() was not being
copied by sub clones.

The previous commit is also part of the fix.

In the tests, I tested the combination of sub cloning and recursion,
since it seemed like a good idea (and also as a result of copying and
pasting :-).

S_pmtrans was still relying on the old logic, so it gets changed, too.

10 years agoStop recursion from losing lex fh names
Father Chrysostomos [Tue, 20 Aug 2013 00:39:45 +0000 (17:39 -0700)]
Stop recursion from losing lex fh names

sub r {
    r($_[0]-1) if $_[0];
    open my $fh, "/dev/null";
    print "$_[0] $$fh\n"
}
r(5);
__END__

Output:
0 *main::
1 *main::
2 *main::
3 *main::
4 *main::
5 *main::$fh

The largest number represents the outermost call.

The handle name was being allocated as a target (a scratch variable
used by various operators to return values).  Targets are not shared
between recursion levels.

This commit tells pad_alloc to treat it like a constant, so it
is shared.