This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perl5.git
8 years agoUnused dTHX, even under threads.
Jarkko Hietaniemi [Thu, 29 May 2014 14:26:54 +0000 (10:26 -0400)]
Unused dTHX, even under threads.

[perl #121882].

Fix for Coverity perl5 CID 49935:
Unused pointer value (UNUSED_VALUE)
returned_pointer: Pointer my_perl returned by
pthread_getspecific(PL_thr_key) is never used.

8 years ago __APPLE__ is not Apple, use PERL_DARWIN instead.
Jarkko Hietaniemi [Thu, 29 May 2014 14:21:58 +0000 (10:21 -0400)]
 __APPLE__ is not Apple, use PERL_DARWIN instead.

See hints/darwin.sh for details.

8 years agoReindent the block. Whitespace-only change.
Jarkko Hietaniemi [Thu, 29 May 2014 14:17:51 +0000 (10:17 -0400)]
Reindent the block. Whitespace-only change.

Followup to 99e8c5.

8 years agoFix false nesting.
Jarkko Hietaniemi [Thu, 29 May 2014 14:13:08 +0000 (10:13 -0400)]
Fix false nesting.

[perl #121744]

Fix for Coverity perl5 CID 29014:
Nesting level does not match indentation (NESTING_INDENT_MISMATCH)

(Reindentation of the whole "if (!PL_use_safe_putenv)" block will follow.)

8 years agoUV casting to avoid intermediate sign extension.
Jarkko Hietaniemi [Thu, 29 May 2014 14:01:13 +0000 (10:01 -0400)]
UV casting to avoid intermediate sign extension.

[perl #121746]

Fix for Coverity perl5 CIDs 29069, 29070, 29071:
Unintended sign extension: ... ... if ... U8 (8 bits unsigned) ... 32
bits, signed ...  64 bits, unsigned ... is greater than 0x7FFFFFFF,
the upper bits of the result will all be 1.

8 years agoRemove x2p
Leon Timmermans [Wed, 21 May 2014 11:56:54 +0000 (13:56 +0200)]
Remove x2p

This removes find2perl, s2p and a2p from core. They have all been
released to CPAN as separate distributions.

8 years agoStandardize spelling of program name on American English.
Doug Bell [Thu, 29 May 2014 12:23:42 +0000 (08:23 -0400)]
Standardize spelling of program name on American English.

For: https://rt.perl.org/Ticket/Display.html?id=121978

8 years agotemporary fix for [perl #121975] COW speedup lost after e8c6a474
Yves Orton [Thu, 29 May 2014 09:33:56 +0000 (11:33 +0200)]
temporary fix for [perl #121975] COW speedup lost after e8c6a474

Disable use of Perl_safesysmalloc_size by default. Only use it when PERL_USE_MALLOC_SIZE is defined.

Using Perl_safesysmalloc_size() perl cannot tell a deliberately preallocated buffer
which we probably dont want to COW from a malloc() preallocated buffer where we probably
dont care. Hopefully this fixes the slowdown observed on some platforms.

8 years agoQuad_t and Uquad_t cannot unpack as NVs.
Jarkko Hietaniemi [Tue, 6 May 2014 16:50:55 +0000 (12:50 -0400)]
Quad_t and Uquad_t cannot unpack as NVs.

If IVSIZE >= 8, a Quad_t is always >= IV_MIN, and <= IV_MAX, and an
Uquad_t is always (>= 0 aka UV_MIN and) <= UV_MAX; they cannot escape
their quadness and be NVs.  (This logic may fail if Quad_t is not 8
bytes, but then other things would no doubt fail.)

Also tighten the logic by adding HAS_QUAD, also for the pack case.

Fix for Coverity perl5 CID 28942.

8 years agosi_names access one past the end.
Jarkko Hietaniemi [Fri, 9 May 2014 22:49:25 +0000 (18:49 -0400)]
si_names access one past the end.

Fix for Coverity perl5 CID 45359.

8 years agocleanup on commit "Pseudo-fork dups arg array on argless calls"
Daniel Dragan [Tue, 29 Apr 2014 16:27:42 +0000 (12:27 -0400)]
cleanup on commit "Pseudo-fork dups arg array on argless calls"

less branching, less cpu intructions, easier to read

8 years agoput va_end() in the right place
Tony Cook [Thu, 22 May 2014 01:05:59 +0000 (11:05 +1000)]
put va_end() in the right place

8 years agobump $PerlIO::via::VERSION to 0.15
Tony Cook [Tue, 20 May 2014 05:06:16 +0000 (15:06 +1000)]
bump $PerlIO::via::VERSION to 0.15

8 years agoadd va_end() calls where missing for a va_start() or va_end().
Jarkko Hietaniemi [Wed, 23 Apr 2014 16:53:42 +0000 (12:53 -0400)]
add va_end() calls where missing for a va_start() or va_end().

Fix for Coverity perl5 CIDs 29225, 29226, 29227, 29228, 29229: Missing
varargs init or cleanup (VARARGS) missing va_end: va_end was not
called for foo.

Use of va_args must be finished off with va_end (in other words,
use of va_start or va_copy must be bracketed off with va_end).
In most platforms va_end is a no-op, but in some platforms it is
required for proper cleanup (or face stack smash, or memory leak).

Tony: move va_start() out of the declaration block

8 years agoremove comment that no longer applies
Tony Cook [Wed, 21 May 2014 00:45:58 +0000 (10:45 +1000)]
remove comment that no longer applies

8 years agobump $XS::APItest::VERSION to 0.61
Tony Cook [Tue, 20 May 2014 05:06:33 +0000 (15:06 +1000)]
bump $XS::APItest::VERSION to 0.61

8 years agoPointers set but then (immediately or very shortly) overwritten.
Jarkko Hietaniemi [Sat, 26 Apr 2014 01:52:54 +0000 (21:52 -0400)]
Pointers set but then (immediately or very shortly) overwritten.

Fix for Coverity perl5 CIDs 29203, 29207, 29211, 29214, 29217, 29218,
29222: Unused pointer value (UNUSED_VALUE) Pointer foo returned by
bar() is overwritten.

8 years agoUninitialized tmbuf.
Jarkko Hietaniemi [Wed, 7 May 2014 13:26:52 +0000 (09:26 -0400)]
Uninitialized tmbuf.

Fix for Coverity perl5 CID 29088: Uninitialized scalar variable (UNINIT)
uninit_use: Using uninitialized value tmbuf.tm_year.

There is a code path that can lead to accessing uninitialized tmbuf:
when the too-small or too-large time inputs to gmtime/localtime
happen.

- make it so that the tm_year is used only on successful code path:
  pp_sys.c
- add the gmtime failed / localtime failed errors to perldiag:
  pod/perldiag.pod
- test those errors: t/op/time.t

8 years agofd closes for failure paths.
Jarkko Hietaniemi [Wed, 7 May 2014 13:30:35 +0000 (09:30 -0400)]
fd closes for failure paths.

Fix for Coverity perl5 CIDs 29053, 29055, 29057: Resource leak (RESOURCE_LEAK)
leaked_handle: Handle variable fd going out of scope leaks the handle.

8 years agoMake UINT64_C()/INT64_C() available anytime HAS_QUAD is defined
Tony Cook [Thu, 29 May 2014 04:39:26 +0000 (14:39 +1000)]
Make UINT64_C()/INT64_C() available anytime HAS_QUAD is defined

Prevent the failure for 32-bit builds on C89 compilers introduced in
f4e3fd268af3.

8 years agoRevert "Upgrade Digest::SHA from version 5.88 to 5.91"
Karl Williamson [Thu, 29 May 2014 01:19:03 +0000 (19:19 -0600)]
Revert "Upgrade Digest::SHA from version 5.88 to 5.91"

This reverts commit d3013bbfc3b14e06bdc794c44d15e95024343369,
because it is breaking blead compiles of C++ because it is using 'class'
as a formal parameter, and that is a reserved word in C++

8 years agoRevert "Upgrade Term::Cap from version 1.15 to 1.16"
Karl Williamson [Wed, 28 May 2014 23:15:30 +0000 (17:15 -0600)]
Revert "Upgrade Term::Cap from version 1.15 to 1.16"

This reverts commit 60d2b2aebfceab38ad669bac181bb68e42c05cb2.
because we are getting test failures in blead:

../cpan/podlators/t/basic.t                                     (Wstat: 256 Tests: 15 Failed: 1)
  Failed test:  15
  Non-zero exit status: 1
../cpan/podlators/t/termcap.t                                   (Wstat: 512 Tests: 4 Failed: 2)
  Failed tests:  3-4
  Non-zero exit status: 2

I only bisected the first test to this commit, but it seems likely that
the second test is from it too.  We'll know soon enough

8 years agoDoug Bell is now a perl author
Tony Cook [Tue, 13 May 2014 01:05:56 +0000 (11:05 +1000)]
Doug Bell is now a perl author

8 years agomove given/when ~~ note below item introducing it
Doug Bell [Tue, 13 May 2014 00:50:41 +0000 (10:50 +1000)]
move given/when ~~ note below item introducing it

The note explaining to use $c ~~ $_ instead of $_ ~~ $c was put under the item
introducing all binary operators, and not the one mentioning the explicit
smartmatch operator.

8 years agoFixes for running a clean minitest (at least in OS X). - detect POSIX locale support...
Jarkko Hietaniemi [Sat, 19 Apr 2014 19:38:40 +0000 (15:38 -0400)]
Fixes for running a clean minitest (at least in OS X). - detect POSIX locale support differently: t/op/lc.t, t/uni/fold.t - detect PerlIO::scalar differently: t/op/pwent.t - bail out earlier if no dscl: t/op/op/pwent.t - avoid wide character warning: t/op/tr.t

8 years agoGrammatical correction.
James E Keenan [Thu, 29 May 2014 01:04:05 +0000 (03:04 +0200)]
Grammatical correction.

8 years agoperldelta for e16b8d1b7d43, 32f4893f37f4
Tony Cook [Thu, 29 May 2014 00:48:04 +0000 (10:48 +1000)]
perldelta for e16b8d1b7d4332f4893f37f4

8 years agoFix RT #62052: Math::BigFloat -> bdiv() in list context
pjacklam [Tue, 15 Apr 2014 21:03:18 +0000 (23:03 +0200)]
Fix RT #62052: Math::BigFloat -> bdiv() in list context

In list context, Math::BigFloat -> bdiv() returns the quotient and remainder.
By convention, this means that the quotient and remainder, q and r, after
dividing x by y, satisfies x = q*y + r. The current behaviour is to return x/y
and r, which do not satisfy this relation, and - more importantly - is not what
people expect.

dist/Math-BigInt/lib/Math/BigFloat.pm: Patched to fix this bug.

t/bigfltpm.inc and t/upgrade.inc: Fixed test cases to match the new behaviour.

8 years agoFix RT #43692: Math::BigFloat -> blog() is sometimes incorrect
pjacklam [Tue, 15 Apr 2014 15:57:02 +0000 (17:57 +0200)]
Fix RT #43692: Math::BigFloat -> blog() is sometimes incorrect

dist/Math-BigInt/lib/Math/BigFloat.pm: Patched as suggested in RT #43692.
blog(x) would sometimes return blog(2*x) when the accuracy was greater than
70 digits.

t/biglog.t: Fixed incorrect use of ok(). Edited a test case so it fails without
this patch.

8 years agoperldelta for 945313f0aee2, c4885710b2c3
Tony Cook [Thu, 29 May 2014 00:18:32 +0000 (10:18 +1000)]
perldelta for 945313f0aee2c4885710b2c3

8 years agobump dist/Math-BigInt/ $VERSIONs
Tony Cook [Tue, 13 May 2014 00:21:57 +0000 (10:21 +1000)]
bump dist/Math-BigInt/ $VERSIONs

8 years agoSync Math-BigInt blead vs. CPAN
Peter John Acklam [Wed, 9 Apr 2014 09:46:01 +0000 (11:46 +0200)]
Sync Math-BigInt blead vs. CPAN

Some POD changes, and a version number increase for consistency between all
.pm files, were accidentally included in the CPAN release of Math-BigInt
before they were included in blead. This patch gets the modules in sync.

8 years agoAdd comment about tmpnam().
Jarkko Hietaniemi [Wed, 28 May 2014 18:11:12 +0000 (14:11 -0400)]
Add comment about tmpnam().

8 years ago[perl #121431] - Document test.valgrind in perlhacktips.pod
Matthew Horsfall (alh) [Wed, 28 May 2014 17:53:19 +0000 (13:53 -0400)]
[perl #121431] - Document test.valgrind in perlhacktips.pod

8 years agoFix for Coverity perl5 CID 29068: Insecure temporary file (SECURE_TEMP) secure_temp...
Jarkko Hietaniemi [Thu, 24 Apr 2014 16:23:18 +0000 (12:23 -0400)]
Fix for Coverity perl5 CID 29068: Insecure temporary file (SECURE_TEMP) secure_temp: Calling mkstemp() without securely setting umask first.

The umask used for mkstemp should be secure, but umask 0600 has been
the required umask only since POSIX.1-2008.  In glibc 2.06 and earlier
the default was 0666, which is not secure.  And no explicit knowledge
of how well non-glibc platforms implement mkstemp.  Better err on the
side security, so set the umask temporarily to 0600, and then restore it.

8 years agoAnnotate intentional case fallthrough, or add breaks.
Jarkko Hietaniemi [Sun, 4 May 2014 23:44:24 +0000 (19:44 -0400)]
Annotate intentional case fallthrough, or add breaks.

Fix suspicious (*) switch cases found by Coverity by
annotating with either "/* FALLTHROUGH */" or adding a break;

The FALLTHROUGH was much more common, but the break turned
out to be the right choice in three spots.  All changes tested
to work.

(*) suspicious = case1 + code + case2, and neither flow control
(like break) nor fallthrough annotation between code and case2.

Fix for Coverity perl5 CIDs 28977..28989, 45353.

8 years agoFix for Coverity perl5 CID 28936: Wrong operator used (CONSTANT_EXPRESSION_RESULT)
Jarkko Hietaniemi [Fri, 25 Apr 2014 12:25:52 +0000 (08:25 -0400)]
Fix for Coverity perl5 CID 28936: Wrong operator used (CONSTANT_EXPRESSION_RESULT)

operator_confusion: ret->flags | 0x10 is always 1/true regardless of
the values of its operand. This occurs as the logical first operand of '&&'.
Did you intend to use '&' rather than '|'?

(confirmed by Karl Williamson)

8 years agoslen may be uninitialized.
Jarkko Hietaniemi [Wed, 7 May 2014 13:25:04 +0000 (09:25 -0400)]
slen may be uninitialized.

Fix for Coverity perl5 CID 29081: Uninitialized scalar
variable (UNINIT) uninit_use_in_call: Using uninitialized value slen when
calling Perl_croak.

If all fails, slen hasn't been set, and croak will be called with that.

8 years agoLeaked string in failure path.
Jarkko Hietaniemi [Wed, 7 May 2014 13:22:16 +0000 (09:22 -0400)]
Leaked string in failure path.

Fix for Coverity perl5 CID 29058: Resource leak
(RESOURCE_LEAK) leaked_storage: Variable codeset going out of scope leaks the
storage it points to.

The savepv-ed codeset was not freed in failure path.
(The save_input_locale is freed just few lines later.)

8 years ago[perl #121976] - Fix typo in pod
Matthew Horsfall (alh) [Wed, 28 May 2014 17:03:10 +0000 (13:03 -0400)]
[perl #121976] - Fix typo in pod

8 years ago[perl #121431] Add support for test.valgrind parallel testing.
Matthew Horsfall (alh) [Thu, 13 Mar 2014 12:39:48 +0000 (05:39 -0700)]
[perl #121431] Add support for test.valgrind parallel testing.

Output for each test will be printed inline when it finishes.

Sample usage (loud):

  TEST_JOBS=9 make test.valgrind

Sample usage (quiet):

  VG_OPTS='-q --leak-check=no --show-reachable=no' TEST_JOBS=9 make test.valgrind

8 years agoMove the PERL_GCC_BRACE_GROUPS_FORBIDDEN earlier.
Jarkko Hietaniemi [Wed, 28 May 2014 16:46:05 +0000 (12:46 -0400)]
Move the PERL_GCC_BRACE_GROUPS_FORBIDDEN earlier.

The PERL_UNUSED_RESULT needs it to avoid using the brace groups
when going -pedantic.

8 years agoRemove +x from Term::ANSIColor test files.
Nicholas Clark [Wed, 28 May 2014 16:38:14 +0000 (18:38 +0200)]
Remove +x from Term::ANSIColor test files.

Commit 5e64492f6452260c seems to have accidentally changed the mode of the
files.

8 years agoBump module versions following commit 3800c3188602fdac.
Nicholas Clark [Wed, 28 May 2014 16:36:18 +0000 (18:36 +0200)]
Bump module versions following commit 3800c3188602fdac.

8 years agoUpdate Term-ANSIColor to CPAN version 4.03
Chris 'BinGOs' Williams [Wed, 28 May 2014 15:38:12 +0000 (16:38 +0100)]
Update Term-ANSIColor to CPAN version 4.03

  [DELTA]

Term::ANSIColor 4.03 (2014-03-23)

    Switch the module build system to Module::Build, but still generate a
    Makefile.PL file for backward compatibility and for the use of Perl
    core.

    Fix typo in SYNOPSIS (colorstrip example) and duplicated word.
    Thanks, Olivier MenguĂ© and David Steinbrunner.  (#85480, #94006)

    Skip POD and some other style tests unless doing automated or release
    testing.  Skip POD spelling, coverage, and Perl::Critic tests unless
    doing author testing.  Use the Lancaster Consensus environment
    variables instead of RRA_MAINTAINER_TESTS.  (#93474)

    Add SEE ALSO reference to Win32::Console::ANSI.  (#87295)

8 years agoUpdated META files for CPAN-Meta upgrade
Chris 'BinGOs' Williams [Wed, 28 May 2014 15:25:32 +0000 (16:25 +0100)]
Updated META files for CPAN-Meta upgrade

8 years agoUpdate CPAN-Meta to CPAN version 2.141170
Chris 'BinGOs' Williams [Wed, 28 May 2014 15:21:19 +0000 (16:21 +0100)]
Update CPAN-Meta to CPAN version 2.141170

  [DELTA]

2.141170  2014-04-27 13:03:37-04:00 America/New_York

  [ADDED]

  - Added ability for CPAN::Meta::Converter to convert metadata fragments
    (incomplete portions of a metadata structure)

  [CHANGED]

  - Optimized internal use of JSON for datastructure cloning

  [FIXED]

  - Removed dependency on List::Util 1.33

  [DOCUMENTED]

  - Clarified language around 'dynamic_config' in the Spec

8 years agoUpgrade Unicode::Normalize from version 1.17 to 1.18
Steve Hay [Wed, 28 May 2014 13:39:41 +0000 (14:39 +0100)]
Upgrade Unicode::Normalize from version 1.17 to 1.18

8 years agoUpgrade Unicode::Collate from version 1.04 to 1.07
Steve Hay [Wed, 28 May 2014 11:37:53 +0000 (12:37 +0100)]
Upgrade Unicode::Collate from version 1.04 to 1.07

8 years agoUpgrade Term::Cap from version 1.15 to 1.16
Steve Hay [Wed, 28 May 2014 11:31:16 +0000 (12:31 +0100)]
Upgrade Term::Cap from version 1.15 to 1.16

8 years agoUpgrade Digest::SHA from version 5.88 to 5.91
Steve Hay [Wed, 28 May 2014 13:28:13 +0000 (14:28 +0100)]
Upgrade Digest::SHA from version 5.88 to 5.91

8 years agoTrailing comma in enum is not C89.
Jarkko Hietaniemi [Wed, 28 May 2014 15:43:53 +0000 (11:43 -0400)]
Trailing comma in enum is not C89.

8 years agoUse STRUCT_OFFSET() instead raw C99 offsetof().
Jarkko Hietaniemi [Wed, 28 May 2014 15:32:34 +0000 (11:32 -0400)]
Use STRUCT_OFFSET() instead raw C99 offsetof().

That is, offsetof() is available only iff not C89 pedantic gcc.

(Socket.xs needs fixing, too, but it's cpan/Socket.)

8 years agog++ cleanups.
Jarkko Hietaniemi [Wed, 28 May 2014 15:09:23 +0000 (11:09 -0400)]
g++ cleanups.

regcomp.c:11083: warning: suggest a space before ';' or explicit braces around empty body in 'for' statement

locale.c:1113: warning: comparison between signed and unsigned integer expressions

8 years agoUINT64_C/INT64_C logic shuffling.
Jarkko Hietaniemi [Wed, 28 May 2014 14:41:16 +0000 (10:41 -0400)]
UINT64_C/INT64_C logic shuffling.

(1) Prefer the native int/long over long long (not in C89!) or __int64.
(2) Define them only if necessary, they might be defined in <stdint.h> by C99
(3) However, note the C99.  They might not be available in strict C89.
(4) In OS X they are defined with ULL/LL, which will not be
    to the liking of C89 pedantic gcc.

8 years agoUse UINT64_C for UV constants.
Jarkko Hietaniemi [Wed, 28 May 2014 13:32:34 +0000 (09:32 -0400)]
Use UINT64_C for UV constants.

8 years agoHide the VMS error identifier SS$_NOPRIV, as customary.
Jarkko Hietaniemi [Wed, 28 May 2014 13:24:14 +0000 (09:24 -0400)]
Hide the VMS error identifier SS$_NOPRIV, as customary.

8 years agoOff-by-one in PL_fold_locale use.
Jarkko Hietaniemi [Wed, 7 May 2014 13:19:00 +0000 (09:19 -0400)]
Off-by-one in PL_fold_locale use.

Fix for Coverity perl5 CID 29033: Out-of-bounds read
 (OVERRUN) overrun-local: Overrunning array PL_fold_locale of 256 bytes at
 byte offset 256 using index c1 (which evaluates to 256).

- the "c1 > 256" was off-by-one, it needed to be "c1 > 255",
  it could have caused the PL_fold_locale to be accessed one past the end,
  at offset 256, but we have dodged the bullet thanks to the regex engine
  optimizing the bad case away before we hit it (analysis by Karl Williamson):
  regexec.c
- comment fixes (pointed out by Karl Williamson): regexec.c
- add tests to nail down the behaviour of fold matching
  for the last of Latin-1 (0xFF, lowercase which curiously does not have
  uppercase within Latin-1). and the first pure Unicode: t/re/pat.t

8 years agoCannot rotl u32 (hek_hash) by 64 bits.
Jarkko Hietaniemi [Tue, 13 May 2014 12:18:05 +0000 (08:18 -0400)]
Cannot rotl u32 (hek_hash) by 64 bits.

Fix for Coverity perl5 CID 28935:
Operands don't affect result (CONSTANT_EXPRESSION_RESULT)
result_independent_of_operands: (unsigned long)entry->hent_hek->hek_hash >> 47 /* 64 - 17 */ is 0 regardless of the values of its operands. This occurs as the bitwise second operand of '|'.

8 years agofix sv_usepvn_flags's docs
Daniel Dragan [Wed, 14 May 2014 08:08:13 +0000 (04:08 -0400)]
fix sv_usepvn_flags's docs

Newx != malloc, mixing Newx and malloc leads to heap corruption on some
builds like Win32, use the official Perl API for allocating memory.

8 years agoUse the C_ARRAY_LENGTH.
Jarkko Hietaniemi [Mon, 19 May 2014 10:52:24 +0000 (06:52 -0400)]
Use the C_ARRAY_LENGTH.

Use the C_ARRAY_LENGTH instead of sizeof(c_array)/sizeof(c_array[0])
or sizeof(c_array)/sizeof(type_of_element_in_c_array), and C_ARRAY_END
for c_array + C_ARRAY_LENGTH(c_array).

While doing this found potential off-by-one error in sv.c:Perl_sv_magic:
how > C_ARRAY_LENGTH(PL_magic_data)
should probably have been
how >= C_ARRAY_LENGTH(PL_magic_data)
No tests fail, but this seems to be more of an internal sanity check.

8 years agoUCHARAT unnecessary with isSPACE().
Jarkko Hietaniemi [Tue, 6 May 2014 14:40:21 +0000 (10:40 -0400)]
UCHARAT unnecessary with isSPACE().

UCHARAT is not only unnecessary here (and no other spot in the core
seems to use UCHARAT with isFOO()), but it also narrows the type so
that some of the code in isSPACE() becomes unreachable.

Fix for Coverity perl5 CIDs 28937, 28938.

8 years agoDo not invert a NULL cp_list.
Jarkko Hietaniemi [Fri, 9 May 2014 15:05:30 +0000 (11:05 -0400)]
Do not invert a NULL cp_list.

Fix for Coverity perl5 CID 28966.

8 years agoFixup for [perl #121860]: g++ and VC are pickier about what's
Jarkko Hietaniemi [Wed, 28 May 2014 12:52:44 +0000 (08:52 -0400)]
Fixup for [perl #121860]: g++ and VC are pickier about what's
an expression and what's a statement.

8 years agoFix EXTEND changes under STRESS_REALLOC
Steffen Mueller [Wed, 28 May 2014 12:11:40 +0000 (14:11 +0200)]
Fix EXTEND changes under STRESS_REALLOC

As part of aad79b331c21c962b6e0ce7b8027aa625d7445ec, -DSTRESS_REALLOC was broken.
This should alleviate that.

8 years agoperlhist: add release date for 5.21.0
Ricardo Signes [Wed, 28 May 2014 11:59:05 +0000 (07:59 -0400)]
perlhist: add release date for 5.21.0

8 years agoAdd PERL_UNUSED_RESULT() and use that instead of the V_Gconvert().
Jarkko Hietaniemi [Mon, 28 Apr 2014 00:52:54 +0000 (20:52 -0400)]
Add PERL_UNUSED_RESULT() and use that instead of the V_Gconvert().

8 years agoAvoid "unused sp" if EXTEND is the last mentioning sp.
Jarkko Hietaniemi [Tue, 20 May 2014 11:44:06 +0000 (07:44 -0400)]
Avoid "unused sp" if EXTEND is the last mentioning sp.

Add PERL_UNUSED_VAR(sp) in case the EXTEND (or MEXTEND)
is the last thing mentioning the sp.

Addresses Coverity perl5 CIDs 29199..29201, 29204, 29205, 29206,
29208, 29210, 29212, 29213, 29215, 29216, 29219..29221.

8 years agoAccessing array before its start is dubious.
Jarkko Hietaniemi [Wed, 7 May 2014 16:04:37 +0000 (12:04 -0400)]
Accessing array before its start is dubious.

Fix by petermartini.

Fix for Coverity perl5 CID 28909:
Out-of-bounds access (ARRAY_VS_SINGLETON)
ptr_arith: Using &unsliced_keysv as an array.
This might corrupt or misinterpret adjacent memory locations.

8 years agoFor ptr masking use PTRSIZE-1, not nested conditional statement.
Jarkko Hietaniemi [Wed, 30 Apr 2014 11:49:07 +0000 (07:49 -0400)]
For ptr masking use PTRSIZE-1, not nested conditional statement.

8 years agorefactor pp_list
Daniel Dragan [Sun, 18 May 2014 02:10:01 +0000 (22:10 -0400)]
refactor pp_list

-move PL_stack_sp and PL_stack_base reads into the branch in which they
 are used, this also removes 1 var from being saved across the function
 call in GIMME, which removes saving and restoring 1 non-vol register
-write SP to PL_stack_sp (PUTBACK) only if it was changed
-POPMARK is mutable, it must execute on all branches

this reduced pp_list's machine code size of the function from 0x58 to
0x53 bytes on VC 2003 -01 32 bits

8 years agoMemory leak in Storable::dclone with STORABLE_freeze hook
Alex Solovey [Wed, 21 May 2014 06:27:14 +0000 (16:27 +1000)]
Memory leak in Storable::dclone with STORABLE_freeze hook

Storable documentation recommends using dclone shortcut in
STORABLE_freeze hook: "Unless you know better, serializing hook should
always say:
                sub STORABLE_freeze {
                    my ($self, $cloning) = @_;
                    return if $cloning; # Regular default serialization
                    ....
                }

            in order to keep reasonable dclone() semantics."

However, this causes a memory leak which is easy to observe with the
following small script:

=== storable-leak.plx ===
use Storable qw( dclone );

package Foo {
     sub new { return bless {}, __PACKAGE__ }

     sub STORABLE_freeze {
         my( $self, $cloning ) = @_;
         # Switch to regular default serialization results in memory leak
         return if $cloning;
         return 'Foo';
     }
}

my $d = Foo->new();
while(1)
{
     dclone( $d );
}
===

The leak is caused by missing cleanup of empty array value returned by
the hook. I've attached a simple patch for Storable-2.45 which fixes
this issue.

Reported in [perl #121928]

Amended to include version bump and Storable changelog entry.

8 years agoregen Makefile.SH
David Mitchell [Wed, 28 May 2014 10:04:12 +0000 (11:04 +0100)]
regen Makefile.SH

I ran regen/lib_cleanup.pl because porting/regen.t was failing.

No I don't understand this area at all. And I don't think 'make realclean'
is doing what its supposed to be doing.

8 years agoUpdate Test-Simple to CPAN version 1.001003
Chris 'BinGOs' Williams [Tue, 27 May 2014 21:49:00 +0000 (22:49 +0100)]
Update Test-Simple to CPAN version 1.001003

  [DELTA]

1.001003     Fri Mar  21 21:12:32 PST 2014
    * Doc updates for maintainer change

8 years agoUpdate autodie to CPAN version 2.25
Chris 'BinGOs' Williams [Tue, 27 May 2014 21:45:06 +0000 (22:45 +0100)]
Update autodie to CPAN version 2.25

  [DELTA]

2.25      2014-04-03 09:43:15EST+1100 Australia/Melbourne

        * DOCS: Spelling fixes in autodie::ScopeUtil
                (Courtesy Salvatore Bonaccorso)

2.24      2014-03-30 19:30:10EST+1100 Australia/Melbourne

        * FEATURE: Provide a stack backtrace when `Carp::Always` is enabled.
                   Note that sometimes this is not as pretty as it could
                   be, patches welcome.
                   (Thanks to Niels Thykier, GH #35)

        * BUGFIX: Fix situations where `no autodie` doesn't respect lexical
                  scope. (Thanks to Niels Thykier, GH #41, RT #72053,
                  RT #86396)

        * INTERNAL: Remove now unused variables in code (Niels Thykier).

        * DOCS: Make it extra-clear autodie doesn't check `print`.
                (Dave Rolsky, GH #39)

        * TEST: Removed obsolete boilerplate.t

        * TEST / INTERNAL: Enabled travis-ci for Perl 5.8

        * TEST: Stopped some Pod::Coverage tests failing under Perl 5.8

        * BUILD: Better support for building in a read-only directory
                 (courtesy Andrew Fresh, GH #46)

8 years agoUpdate Module-Metadata to CPAN version 1.000022
Chris 'BinGOs' Williams [Tue, 27 May 2014 21:38:10 +0000 (22:38 +0100)]
Update Module-Metadata to CPAN version 1.000022

  [DELTA]

1.000022 - 2014-04-29
  - work around change in comparison behaviour in Test::More 0.95_01 by being
    more explicit with our tests - now explicitly checking the string form of
    the extracted version, rather than the entire version object
  - ensure the extracted version is returned as a version object in all cases
    (RT#87782, Randy Stauner)

1.000021 - 2014-04-29
  - fix use of newer interface from File::Path, to avoid another prereq on
    older perls (Graham Knop, PR#7)
  - fixed all out of date prereq declarations

1.000020 - 2014-04-27
  - new is_indexable() object method (ether, RT#84357)
  - eliminated dependency on IO::File (and by virtue, XS) - thanks, leont!
  - removed cruft in test infrastructure left behind from separation from
    Module::Build (ether)
  - repository moved to https://github.com/Perl-Toolchain-Gang/Module-Metadata
  - .pm file is now wholly ascii, for nicer fatpacking (RT#95086)
  - some code micro-optimizations (Olivier MenguĂ©, PR#4)

8 years agoperldelta for a7752796dd84, 0baa1af7fb9e
Tony Cook [Wed, 28 May 2014 06:18:13 +0000 (16:18 +1000)]
perldelta for a7752796dd840baa1af7fb9e

8 years agobump Math::BigRat $VERSION
Tony Cook [Tue, 13 May 2014 00:09:34 +0000 (10:09 +1000)]
bump Math::BigRat $VERSION

8 years agoSync Math-BigRat blead vs. CPAN
Peter John Acklam [Wed, 9 Apr 2014 17:30:40 +0000 (19:30 +0200)]
Sync Math-BigRat blead vs. CPAN

Some POD changes were accidentally included in the CPAN release of
Math-BigRat before they were included in blead. This patch gets the
module in sync.

8 years agoPierre Bogossian is now a perl author
Tony Cook [Mon, 12 May 2014 05:52:04 +0000 (15:52 +1000)]
Pierre Bogossian is now a perl author

8 years agoRemove redundant test
Pierre Bogossian [Fri, 4 Apr 2014 18:07:56 +0000 (20:07 +0200)]
Remove redundant test

8 years agoperldelta for a18468ad888b
Tony Cook [Wed, 28 May 2014 05:13:25 +0000 (15:13 +1000)]
perldelta for a18468ad888b

8 years agoIgnore mismatched versions between Carp and Carp::Heavy if the version discrepancy...
Karen Etheridge [Thu, 3 Apr 2014 18:08:20 +0000 (11:08 -0700)]
Ignore mismatched versions between Carp and Carp::Heavy if the version discrepancy does not actually lead to broken code

Carp::Heavy's guts were merged into Carp in 1.12. After this point, if a
different version of Carp::Heavy is loaded than Carp, no harm will be done and
the error can be ignored.

8 years agoperldelta for b464e2b7c8ad
Tony Cook [Wed, 28 May 2014 04:46:56 +0000 (14:46 +1000)]
perldelta for b464e2b7c8ad

8 years agofix the I32 bug for index() and rindex()
Tony Cook [Tue, 15 Apr 2014 01:57:57 +0000 (03:57 +0200)]
fix the I32 bug for index() and rindex()

8 years agoDocument -l on symlinkless file systems
Smylers [Fri, 28 Mar 2014 16:33:05 +0000 (16:33 +0000)]
Document -l on symlinkless file systems

We can rely on -l always being false on platforms that don't support
symlinks:
http://www.nntp.perl.org/group/perl.perl5.porters/2014/03/msg214012.html

8 years agoperldelta for c59f1e04636e
Tony Cook [Wed, 28 May 2014 03:54:07 +0000 (13:54 +1000)]
perldelta for c59f1e04636e

8 years agoFix RT #121509 : perl -d handling chdir().
Shlomi Fish [Thu, 27 Mar 2014 17:07:50 +0000 (19:07 +0200)]
Fix RT #121509 : perl -d handling chdir().

See: https://rt.perl.org/Ticket/Display.html?id=121509

    [perl #121509] perl debugger doesn't save starting dir to restart from

Thanks to Linda Walsh for reporting the problem and RJBS for commenting
for initial approval. Fix and a regression test by Shlomi Fish.

8 years agopp_sys.c: Optimize out a call to PerlIO_get_cnt
Niels Thykier [Sat, 22 Mar 2014 14:54:41 +0000 (15:54 +0100)]
pp_sys.c: Optimize out a call to PerlIO_get_cnt

If PerlIO_getc returns EOF, PerlIO_get_cnt is not going to return a
positive value all of a sudden.

Signed-off-by: Niels Thykier <niels@thykier.net>
8 years agorefactor av_delete
Daniel Dragan [Thu, 13 Mar 2014 06:51:51 +0000 (02:51 -0400)]
refactor av_delete

Some bad code generation/bad optimization from VC caused me to clean this
up. Dont write AvARRAY(av)[key] = NULL twice. It appears in 2 branches
just as written VC asm wise. Don't call sv_2mortal on a NULL SV*. It
works but less efficient. On VC2008 x64 -O1 this func dropped from 0x208
to 0x202 bytes of machine code after this patch.

8 years agoperldelta for babb663abd
Tony Cook [Wed, 28 May 2014 01:44:07 +0000 (11:44 +1000)]
perldelta for babb663abd

8 years agobump perl5db.pl $VERSION to 1.45
Tony Cook [Wed, 28 May 2014 01:12:40 +0000 (11:12 +1000)]
bump perl5db.pl $VERSION to 1.45

8 years agoImplement get_fork_TTY for tmux
Rob Hoelz [Sun, 9 Jun 2013 19:25:09 +0000 (21:25 +0200)]
Implement get_fork_TTY for tmux

8 years agoperldelta for 7cb3f9598b
Tony Cook [Wed, 28 May 2014 01:02:08 +0000 (11:02 +1000)]
perldelta for 7cb3f9598b

8 years ago[perl #121112] only warn if newline is the last non-NUL character
Tony Cook [Mon, 12 May 2014 03:55:36 +0000 (13:55 +1000)]
[perl #121112] only warn if newline is the last non-NUL character

8 years agoHarmonise dist/ versions for CPAN releases
Chris 'BinGOs' Williams [Tue, 27 May 2014 21:35:36 +0000 (22:35 +0100)]
Harmonise dist/ versions for CPAN releases

8 years agoAdd epigraph for Perl 5.21.0.
James E Keenan [Tue, 27 May 2014 18:46:39 +0000 (14:46 -0400)]
Add epigraph for Perl 5.21.0.

8 years agoHarmonise Module-CoreList version for CPAN release
Chris 'BinGOs' Williams [Tue, 27 May 2014 17:38:17 +0000 (18:38 +0100)]
Harmonise Module-CoreList version for CPAN release

8 years agoupdate Module::CoreList for 5.21.1
Ricardo Signes [Tue, 27 May 2014 14:42:12 +0000 (10:42 -0400)]
update Module::CoreList for 5.21.1

Blunder made in the release of 5.21.0:  Module::CoreList was set to version
5.21.1 instead of 5.21.0.  I've at least temporarily given this commit a
dev version.  Worst case, we do that in 5.21.1 and re-sync in 5.21.2.

8 years agoadd new perldelta for 5.21.1
Ricardo Signes [Tue, 27 May 2014 14:36:05 +0000 (10:36 -0400)]
add new perldelta for 5.21.1