This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perl5.git
8 years agoMake postfix dereferencing work without the postderef feature
Aaron Crane [Mon, 13 Jul 2015 11:58:51 +0000 (12:58 +0100)]
Make postfix dereferencing work without the postderef feature

The feature still exists, for compatibility with code that tries to enable
it, but it has no effect. The postderef_qq feature still exists, however.

8 years agochdir.t fix-up for VMS.
Craig A. Berry [Sun, 12 Jul 2015 21:33:26 +0000 (16:33 -0500)]
chdir.t fix-up for VMS.

There is no problem with setting or deleting HOME as there was
back in 58277c145607d, but there is still no way to delete
SYS$LOGIN from the job table.  So we do have to skip testing for
what happens with chdir() when the environment is clear, but it's
not conditional on $Config{d_setenv}.

8 years agoDocument $OLD_PERL_VERSION's history
Karen Etheridge [Thu, 9 Jul 2015 19:10:26 +0000 (12:10 -0700)]
Document $OLD_PERL_VERSION's history

$OLD_PERL_VERSION was added commented-out in Perl 5.6.0, when $PERL_VERSION
became $^V. It remained unimplemented and undocumented until it was added to
perlvar.pod, in the deprecated section, in 5.13.10. It was then implemented in
English.pm in 5.19.10, but remained undocumented until 5.22.0.

8 years agoUse CRTL getlogin and getlogin_r on VMS.
Craig A. Berry [Sun, 12 Jul 2015 03:37:56 +0000 (22:37 -0500)]
Use CRTL getlogin and getlogin_r on VMS.

The CRTL has supplied getlogin since v7.0, so let's not use the
home-made one anymore.  Plus the CRTL als has a reentrant version,
so we'll use that under threads.

8 years agoModule::CoreList->find_version(): refactor for testability.
James E Keenan [Wed, 8 Jul 2015 00:14:58 +0000 (20:14 -0400)]
Module::CoreList->find_version(): refactor for testability.

In order to address weaknesses in the documentation of find_version() in
CoreList.pod, we first had to address its lack of unit tests.  It was
previously only exercised inside the 'corelist' utility.  Refactored
function a bit to expose all its branches for testing.  Then added tests
for the function with and without arguments.  Corrected documentation
for find_version() in CoreList.pod.

Documentation subsequently clarified per feedback from Steve Parker.

For: RT # 125563 (1st of 2 problems cited in that ticket).

8 years agoClarify that deprecated_in() returns a perl version.
James E Keenan [Tue, 7 Jul 2015 22:59:40 +0000 (18:59 -0400)]
Clarify that deprecated_in() returns a perl version.

I.e., a string like 5.010001.  This makes documentation of deprecated_in()
consistent with that of other Module::CoreList functions.

For: RT # 125563 (2nd of two problems raised)

8 years agoRemove obsolete __GNUC__isms under vms/.
Craig A. Berry [Thu, 9 Jul 2015 23:06:00 +0000 (18:06 -0500)]
Remove obsolete __GNUC__isms under vms/.

There used to be some version of GCC 2.x that ran only on VAX that
was capable of building Perl.  But that was 18-20 years ago and
there have been no recent reports of building Perl with gcc on VMS.

If and when a modern version of GCC is ported to VMS (and the
underpinnings are reportedly there as part of GNAT Pro Ada, just
nothing complete or publicly available), these ancient workarounds
are at least as likely to do harm as good.  So get rid of them.

8 years agoDon't create zero-length filename on VMS in Typemap.t
Craig A. Berry [Thu, 9 Jul 2015 22:31:40 +0000 (17:31 -0500)]
Don't create zero-length filename on VMS in Typemap.t

It turns out it's quite legal but then causes other mayhem, such
as confusing things that are looking for the "." directory (because
there is no such thing as a file without an extension so passing
an empty string to fopen creates ".;1" on disk).

Also make this test clean up its test files.

8 years agoimprove debugging of padlist API
Daniel Dragan [Thu, 2 Jul 2015 21:15:19 +0000 (17:15 -0400)]
improve debugging of padlist API

xpadl_alloc should really be pointer to a struct with a flexible array
member, but flexible array members aren't portable enough among CCs. While
debugging the padlist API for memory corruption (caused by an unrelated
XS module), I saw that the pointer in the first slice of xpadl_alloc
pointed to an AV head of gibberish but 2nd slice was fine. This was
confusing and led me to belive the memory corruption was a bad write to
the array in xpadl_alloc. PadlistARRAY's POD a couple pages down mentions
that index 0 is not an AV *, but the struct comments just said
"pointer to beginning of array of AVs " and didnt mention index 0.

Fix the comments to make it clear what xpadl_alloc is. Add a union so it
is easier to analyze a crash dump/breakpoint with a C debugger, without
writing new code "PADNAMELIST * pnl =  PadlistNAMES(pl);" in many places
and recompiling the interp with -O0, just to be able to inspect the
padnamelist struct.

8 years agoperldelta: Fix typo
Karl Williamson [Wed, 8 Jul 2015 16:07:06 +0000 (10:07 -0600)]
perldelta: Fix typo

8 years agoall SV inheriter types have DEBUG_LEAKING_SCALARS data, so always show it
Daniel Dragan [Thu, 2 Jul 2015 21:22:09 +0000 (17:22 -0400)]
all SV inheriter types have DEBUG_LEAKING_SCALARS data, so always show it

I noticed AV *s in my C debugger didn't the sv_debug_* members, but if I
casted the AV * to a SV * in my C debugger using a expession in my watch
tab, all the info was there. Put the DEBUG_LEAKING_SCALARS in
_SV_HEAD_UNION so the sv_debug_* members appear everywhere (CV/HV/AV/etc),
not just for SVs.

8 years agodont report a $@ exception with uninitialized $!'s message in IPC::Open3
Daniel Dragan [Tue, 7 Jul 2015 16:59:01 +0000 (12:59 -0400)]
dont report a $@ exception with uninitialized $!'s message in IPC::Open3

Commit a24d8dfd08 "Make IPC::Open3 work without fork()" from 5.003 created
an eval block, and if that eval block threw an exception, instead of
propagating $@, the code propagated $!, even though no system call was done
and $! is effectivly unintialized data. In one case for me, a taint
exception inside system was turned into open3() throwing an exception
about "Inappropriate I/O control operation" or "Bad file descriptor", which
had nothing to do with the real fault which was a Perl C level croak with
the message "Insecure $ENV{PATH} while running with -T switch at ..."
which was called as Perl_pp_system->Perl_taint_env->Perl_taint_proper->
Perl_croak->Perl_vcroak. This patch does not try to fix the ambiguity of
the error messages between the !DO_SPAWN and IO::Pipe
branches/implementations of _open3.

8 years agofix #124181 double free/refcnt problems in IO types in typemap
Daniel Dragan [Wed, 24 Jun 2015 19:48:12 +0000 (15:48 -0400)]
fix #124181 double free/refcnt problems in IO types in typemap

commit 50e5165b96 "stop T_IN/OUT/INOUT/STDIO typemaps leaking" changed
newRV to newRV_noinc, but the GV * returned by newGVgen() is owned by the
package tree, like the SV * returned by get_sv(). Now when the RV to GV is
freed on mortal stack, the GV * in the package tree is freed, and now there
is a freed GV * in the package tree, if you turn on "PERL_DESTRUCT_LEVEL=2"
(and perhaps DEBUGGING is needed too), the package tree is destroyed SV *
by SV *, and perl will eventually warn with
"Attempt to free unreferenced scalar" which a very bad panic type warning.

commit 50e5165b96 was reverted in commit bae466e878
"Revert "stop T_IN/OUT/INOUT/STDIO typemaps leaking" for 5.22's release
to stop the panic, but reintroduced the SV/RV leak. So fix the RV leak (the val
passed as source arg of sv_setsv) by freeing it after the copying. In a very
unlikely scenario, the RV could still leak if sv_setsv dies.

Also fix the problem, that if this OUTPUT: type is being used for an
incoming arg, not the outgoing RETVAL arg, you can't assign a new SV*
ontop of the old one, that only works for perl stack return args, so
replace "$arg = &PL_sv_undef;" with "sv_setsv($arg, &PL_sv_undef);" if its
not RETVAL, this way OUTPUT on incoming args also works if it goes down the
error path. For efficiency, in a RETVAL siutation, let the undef original
SV* in $arg which is typically obtained from sv_newmortal() by xsubpp pass
through if we error out.

Also for efficiency, if it is RETVAL (which is more common) dont do the
sv_setsv/SvREFCNT_dec_NN stuff (2 function calls), just mortalize
(1 function call) the ex-temp RV and arrange for the RV to wind up on
perl stack.

Also, the GV * already knows what HV * stash it belongs to, so avoid the
stash lookup done by gv_stashpv() and just use GvSTASH which are simple
pointer derefs.

8 years agoadd test that fails for #124181 to Typemap.t
Daniel Dragan [Sun, 10 May 2015 15:36:05 +0000 (11:36 -0400)]
add test that fails for #124181 to Typemap.t

These tests will either fail with harness, and randomly SEGV for
me, which is intentional since they are testing memory
corruption.

8 years ago[perl #125373] set $! in chdir() if env not set, clarify docs
Tony Cook [Tue, 23 Jun 2015 00:21:45 +0000 (10:21 +1000)]
[perl #125373] set $! in chdir() if env not set, clarify docs

8 years agoChange wording of warning due to Unicode Standard change
Karl Williamson [Wed, 13 May 2015 23:57:06 +0000 (17:57 -0600)]
Change wording of warning due to Unicode Standard change

Non-characters are no longer forbidden as of Unicode 7.0; they are just
"not recommended".  The wording of the warning changes accordingly.

8 years agoRegenerate Configure after backports and small fixes
H.Merijn Brand [Mon, 6 Jul 2015 14:02:15 +0000 (16:02 +0200)]
Regenerate Configure after backports and small fixes

8 years agofix variable name in case of unknown NAN
H.Merijn Brand [Mon, 6 Jul 2015 07:06:10 +0000 (09:06 +0200)]
fix variable name in case of unknown NAN

8 years agoCreate try.c afresh for pointersize test
H.Merijn Brand [Mon, 6 Jul 2015 06:31:24 +0000 (08:31 +0200)]
Create try.c afresh for pointersize test

8 years agoSome nits in perlsub
Rafael Garcia-Suarez [Mon, 6 Jul 2015 06:09:04 +0000 (08:09 +0200)]
Some nits in perlsub

- DOES was not listed in the list of methods with reserved names
- Remove one useless instance of empty list assignment
- Punctuation

8 years agoperldelta for the shift work.
Jarkko Hietaniemi [Sat, 4 Jul 2015 19:49:23 +0000 (15:49 -0400)]
perldelta for the shift work.

8 years agoperlcommunity.pod updates
Herbert Breunung [Sat, 4 Jul 2015 13:36:48 +0000 (09:36 -0400)]
perlcommunity.pod updates

edits by rjbs

8 years agorestore the perldelta changes moved from perl5230delta
Ricardo Signes [Sat, 4 Jul 2015 02:54:53 +0000 (22:54 -0400)]
restore the perldelta changes moved from perl5230delta

i.e., move them from perl5230delta to the 5.23.1 delta where they
belong

This does not re-add the module changes, as those can be generated
automatically when needed.

8 years agoremove things added to v5.23.0 delta but meant for v5.23.1
Ricardo Signes [Sat, 4 Jul 2015 02:53:10 +0000 (22:53 -0400)]
remove things added to v5.23.0 delta but meant for v5.23.1

8 years agobelatedly set up delta for 5.23.1
Ricardo Signes [Sat, 4 Jul 2015 02:47:23 +0000 (22:47 -0400)]
belatedly set up delta for 5.23.1

8 years agoFix skip count for non-fchdir like win32.
Jarkko Hietaniemi [Sat, 4 Jul 2015 00:21:47 +0000 (20:21 -0400)]
Fix skip count for non-fchdir like win32.

8 years agoTest the warnings.
Jarkko Hietaniemi [Fri, 3 Jul 2015 21:26:57 +0000 (17:26 -0400)]
Test the warnings.

Also allow running the test from the top level: ./miniperl t/op/chdir.t

8 years agoSuperfluous null ptr test warnings by clang 3.7
Jarkko Hietaniemi [Fri, 3 Jul 2015 21:17:51 +0000 (17:17 -0400)]
Superfluous null ptr test warnings by clang 3.7

... nonnull parameter 'stash' will evaluate to 'true' on
first encounter [-Wpointer-bool-conversion]

For similar changes, see 3dc78631ef832e5b64aa86228917984dc5b14f5e

8 years agogcc 5.1.0 thinks RETVAL might end up unset.
Jarkko Hietaniemi [Fri, 3 Jul 2015 14:34:39 +0000 (10:34 -0400)]
gcc 5.1.0 thinks RETVAL might end up unset.

8 years agoLeft overshift of negatives under use integer was still wrong.
Jarkko Hietaniemi [Fri, 3 Jul 2015 13:32:13 +0000 (09:32 -0400)]
Left overshift of negatives under use integer was still wrong.

Follow-up on b3498293: the -1 stuckiness on overshift should apply
only on right shift, not left shift (which should return zero).

8 years agoNon-invasive mojibake fixes
Stanislaw Pusep [Tue, 23 Jun 2015 09:43:10 +0000 (11:43 +0200)]
Non-invasive mojibake fixes

Fixing minor encoding inconsistencies found by scan_mojibake utility
(https://metacpan.org/pod/distribution/Test-Mojibake/bin/scan_mojibake)
This patch is touching only comments/POD/__DATA__

8 years agoperldelta entry for 054a3baf7ca16fe.
Craig A. Berry [Thu, 2 Jul 2015 22:48:40 +0000 (17:48 -0500)]
perldelta entry for 054a3baf7ca16fe.

8 years agoRemove gettimeofday() workarounds for VMS in util.c.
Craig A. Berry [Thu, 2 Jul 2015 22:49:48 +0000 (17:49 -0500)]
Remove gettimeofday() workarounds for VMS in util.c.

VMS has had gettimeofday() since v7.0, released in 1999, so there's
no reason now to be special casing native workarounds.

8 years agoVarious corrections to Porting/Maintainers.pl
Steve Hay [Wed, 1 Jul 2015 07:47:51 +0000 (08:47 +0100)]
Various corrections to Porting/Maintainers.pl

8 years agoUpgrade Encode from version 2.73 to 2.75
Steve Hay [Tue, 30 Jun 2015 12:37:33 +0000 (13:37 +0100)]
Upgrade Encode from version 2.73 to 2.75

8 years agoUpgrade Socket from version 2.019 to 2.020
Steve Hay [Tue, 30 Jun 2015 07:51:45 +0000 (08:51 +0100)]
Upgrade Socket from version 2.019 to 2.020

8 years agoRemove NEW_ from PERL_NEW_COPY_ON_WRITE
Father Chrysostomos [Mon, 29 Jun 2015 01:30:29 +0000 (18:30 -0700)]
Remove NEW_ from PERL_NEW_COPY_ON_WRITE

8 years agoRemove SvRELEASE_IVX
Father Chrysostomos [Mon, 29 Jun 2015 01:27:45 +0000 (18:27 -0700)]
Remove SvRELEASE_IVX

Now that PERL_OLD_COPY_ON_WRITE is gone, it no longer does anything.

8 years agoRemove PERL_OLD_COPY_ON_WRITE
Father Chrysostomos [Mon, 29 Jun 2015 01:26:42 +0000 (18:26 -0700)]
Remove PERL_OLD_COPY_ON_WRITE

8 years ago[perl #125305] handle chdir to closed handle correctly
Tony Cook [Thu, 25 Jun 2015 03:58:57 +0000 (13:58 +1000)]
[perl #125305] handle chdir to closed handle correctly

8 years agobop.t -w clean
Jarkko Hietaniemi [Sun, 28 Jun 2015 15:32:43 +0000 (11:32 -0400)]
bop.t -w clean

8 years agoDocument the new shift behaviors.
Jarkko Hietaniemi [Sun, 28 Jun 2015 12:47:25 +0000 (08:47 -0400)]
Document the new shift behaviors.

8 years agoExplicitly mention that even negative shiftees become UVs first.
Jarkko Hietaniemi [Sun, 28 Jun 2015 12:41:34 +0000 (08:41 -0400)]
Explicitly mention that even negative shiftees become UVs first.

8 years agoDefine left/right shift by negative to mean the reverse shift
Jarkko Hietaniemi [Sun, 28 Jun 2015 02:51:38 +0000 (22:51 -0400)]
Define left/right shift by negative to mean the reverse shift

Coverity CIDs 104765 and 104766

While at it, also define shifting by more than wordsize in bits to be
zero, except that undef 'use integer' (use IVs) right overshift for
negative shiftees means -1.  (This is another corner where C leaves
things undefined.  A common behavior is "shift by modulo worbits",
so that e.g. 1 >> 64 == 1 >> (64 % 64) == 1 >> 0, but this is completely
accidental.)  (Coverity didn't flag this, harder to detect statically.)

Discussion thread at
http://www.nntp.perl.org/group/perl.perl5.porters/2015/06/msg228842.html

8 years agoRequire v7.3-2 or later for VMS builds.
Craig A. Berry [Sun, 28 Jun 2015 17:37:27 +0000 (12:37 -0500)]
Require v7.3-2 or later for VMS builds.

OpenVMS v7.3-2 was released in 2003.  Regular support ended in 2006
and even prior version support will be ending in 2015, so this
seems like a pretty generous minimum for future Perl versions.

A side of effect of this is that OpenVMS VAX will no longer be
supported.  The terminal software release for VAX was v7.3 in 2001
with support ending in 2012.  VAX was a truly great architecture
in the 1970s, 1980s, and 1990s, but it's just missing too many of
the things expected in architectures, file systems and C run-times
of the current century.

De-supporting this older stuff allows quite a bit of code removal
and simplification, hopefully easing the maintenance burden a bit.

8 years agoThe postderef feature is no longer experimental
Aaron Crane [Thu, 11 Jun 2015 12:26:53 +0000 (13:26 +0100)]
The postderef feature is no longer experimental

As proposed by RJBS.

The "5.24" feature bundle (and therefore C<< use v5.24 >>) now enable
postderef and postderef_qq.

I can't find any precedent for what to do with the relevant experimental::*
warnings category when an experimental feature graduates to acceptance. I
have elected to leave the category in place, so that code doing C<< no
warnings "experimental::postderef" >> will continue to work. This means that
C<< use warnings "experimental::postderef" >> is also accepted, but has no
effect.

8 years agoPorting/bisect-runner.pl: Wrap pod lines to 79 cols
Karl Williamson [Sat, 27 Jun 2015 18:57:03 +0000 (12:57 -0600)]
Porting/bisect-runner.pl: Wrap pod lines to 79 cols

8 years agoIncrement $VERSION in 4 .pm files whose .xs has changed.
James E Keenan [Sat, 27 Jun 2015 17:51:28 +0000 (13:51 -0400)]
Increment $VERSION in 4 .pm files whose .xs has changed.

Storable.pm
I18N-Langinfo.pm
POSIX.pm
scalar.pm

8 years agoMissing breaks.
Jarkko Hietaniemi [Wed, 24 Jun 2015 22:45:16 +0000 (18:45 -0400)]
Missing breaks.

Coverity CIDs 118700 and 118701.

8 years agoCannot truncate to negative size.
Jarkko Hietaniemi [Fri, 26 Jun 2015 00:03:38 +0000 (20:03 -0400)]
Cannot truncate to negative size.

Coverity CID 104848

8 years agomkdir() mode is unsigned.
Jarkko Hietaniemi [Thu, 25 Jun 2015 01:25:44 +0000 (21:25 -0400)]
mkdir() mode is unsigned.

Coverity CID 104787.

Of course we could join the new millennium and use mode_t.

8 years agogid_t signedness.
Jarkko Hietaniemi [Thu, 25 Jun 2015 01:23:06 +0000 (21:23 -0400)]
gid_t signedness.

Coverity CID 104786.

8 years agoself cannot be NULL here because PerlIO_push() will deref it.
Jarkko Hietaniemi [Thu, 25 Jun 2015 00:54:07 +0000 (20:54 -0400)]
self cannot be NULL here because PerlIO_push() will deref it.

Coverity CID 104779.

Follow-up on Coverity CID 28973, and the respective commit 316ebaf2.

8 years agoassert(arg) before derefing it since it can be NULL.
Jarkko Hietaniemi [Thu, 25 Jun 2015 01:03:21 +0000 (21:03 -0400)]
assert(arg) before derefing it since it can be NULL.

Coverity CID 104813.

8 years agoassert(cSVOPo) before derefing it.
Jarkko Hietaniemi [Thu, 25 Jun 2015 00:19:55 +0000 (20:19 -0400)]
assert(cSVOPo) before derefing it.

8 years agoassert(key) before it is derefed.
Jarkko Hietaniemi [Wed, 24 Jun 2015 23:52:27 +0000 (19:52 -0400)]
assert(key) before it is derefed.

Coverity CID 104855.

8 years agoassert(perinterp_sv) before sv_setiv() derefs NULL.
Jarkko Hietaniemi [Thu, 25 Jun 2015 00:14:39 +0000 (20:14 -0400)]
assert(perinterp_sv) before sv_setiv() derefs NULL.

Coverity CID 104842.

8 years agoCheck success of store().
Jarkko Hietaniemi [Thu, 25 Jun 2015 00:00:55 +0000 (20:00 -0400)]
Check success of store().

Coverity CID 118699.

8 years agoThere is no SSize_t_size.
Jarkko Hietaniemi [Thu, 25 Jun 2015 01:58:51 +0000 (21:58 -0400)]
There is no SSize_t_size.

Coverity CID 104775.

Seemed to be the only one.

8 years agoIf IVSIZE == LONGSIZE, long cannot be beyond IV_MIN/IV_MAX.
Jarkko Hietaniemi [Wed, 24 Jun 2015 02:28:57 +0000 (22:28 -0400)]
If IVSIZE == LONGSIZE, long cannot be beyond IV_MIN/IV_MAX.

It can be if LONGSIZE > IVSIZE, which should be rather rare
(since Perl aims for at least long, someone would have to
force IV to be 32 bits?)

Coverity CID 104770.

8 years agolseek() SEEK_SET pos may not be negative
Jarkko Hietaniemi [Fri, 26 Jun 2015 12:03:14 +0000 (08:03 -0400)]
lseek() SEEK_SET pos may not be negative

Coverity CID 104832

8 years agonl_langinfo code can be negative.
Jarkko Hietaniemi [Thu, 25 Jun 2015 12:41:13 +0000 (08:41 -0400)]
nl_langinfo code can be negative.

Coverity CID 104814.

8 years agostrtol and strtoul base should be [2, 36] or zero.
Jarkko Hietaniemi [Tue, 23 Jun 2015 11:21:03 +0000 (07:21 -0400)]
strtol and strtoul base should be [2, 36] or zero.

Coverity CID 104817 and CID 104836.

8 years agoshmat id can be invalid.
Jarkko Hietaniemi [Tue, 23 Jun 2015 11:30:58 +0000 (07:30 -0400)]
shmat id can be invalid.

Coverity CID 104852.

8 years agomsgrcv id can be invalid.
Jarkko Hietaniemi [Tue, 23 Jun 2015 11:32:43 +0000 (07:32 -0400)]
msgrcv id can be invalid.

Coverity CID 104825.

8 years agomsgsnd id can be invalid.
Jarkko Hietaniemi [Tue, 23 Jun 2015 11:26:46 +0000 (07:26 -0400)]
msgsnd id can be invalid.

Coverity CID 104833.

8 years agotcsetattr optional_actions can be invalid.
Jarkko Hietaniemi [Thu, 25 Jun 2015 12:56:59 +0000 (08:56 -0400)]
tcsetattr optional_actions can be invalid.

Coverity CID 104815.

8 years agotcsetattr fd can be bad.
Jarkko Hietaniemi [Tue, 23 Jun 2015 11:12:08 +0000 (07:12 -0400)]
tcsetattr fd can be bad.

Coverity CID 104815

8 years agodup2 fds can be bad.
Jarkko Hietaniemi [Tue, 23 Jun 2015 10:58:35 +0000 (06:58 -0400)]
dup2 fds can be bad.

Coverity CID 104812.

8 years agotcdrain fd can be bad.
Jarkko Hietaniemi [Tue, 23 Jun 2015 11:28:57 +0000 (07:28 -0400)]
tcdrain fd can be bad.

Coverity CID 104838.

8 years agotcflush/tcflow/tcsendbreak fd/action can be bad.
Jarkko Hietaniemi [Tue, 23 Jun 2015 10:55:45 +0000 (06:55 -0400)]
tcflush/tcflow/tcsendbreak fd/action can be bad.

Coverity CID 104807.

8 years agolseek fd can be bad.
Jarkko Hietaniemi [Tue, 23 Jun 2015 10:51:37 +0000 (06:51 -0400)]
lseek fd can be bad.

Coverity CID 104788

8 years agoImpossible for entry to be NULL at this point.
Jarkko Hietaniemi [Tue, 23 Jun 2015 02:47:50 +0000 (22:47 -0400)]
Impossible for entry to be NULL at this point.

740        if (return_svp) {
           notnull: At condition entry, the value of entry cannot be NULL.
           dead_error_condition: The condition entry must be true.

CID 104777: Logically dead code (DEADCODE)
dead_error_line: Execution cannot reach the expression NULL inside this statement: return entry ? (void *)&ent....
741            return entry ? (void *) &HeVAL(entry) : NULL;

8 years agoHaving both assert() and if () for maxlen is redundant.
Jarkko Hietaniemi [Tue, 23 Jun 2015 02:25:52 +0000 (22:25 -0400)]
Having both assert() and if () for maxlen is redundant.

Coverity CID 104784

8 years agoCannot do much if putc fails in debug output.
Jarkko Hietaniemi [Tue, 23 Jun 2015 01:57:36 +0000 (21:57 -0400)]
Cannot do much if putc fails in debug output.

Coverity CID 104782 (only flagged the deb.c spot)

8 years agomg_find can return NULL.
Jarkko Hietaniemi [Tue, 23 Jun 2015 01:46:09 +0000 (21:46 -0400)]
mg_find can return NULL.

CID 104831: Dereference null return value (NULL_RETURNS)
43. dereference: Dereferencing a pointer that might be null Perl_mg_find(sv, 112) when calling Perl_magic_existspack. (The dereference is assumed on the basis of the 'nonnull' parameter attribute.)
499                magic_existspack(svret, mg_find(sv, PERL_MAGIC_tiedelem));

8 years agoPossible NULL cxt derefs.
Jarkko Hietaniemi [Tue, 23 Jun 2015 01:31:36 +0000 (21:31 -0400)]
Possible NULL cxt derefs.

Coverity CIDs 104819, 104820, 104821, 104827, 104859, 104860

Using assert() instead of Storable ASSERT() because Coverity
understands the first one.

8 years agosizeof * and sizeof ** not necessarily the same.
Jarkko Hietaniemi [Mon, 22 Jun 2015 23:05:51 +0000 (19:05 -0400)]
sizeof * and sizeof ** not necessarily the same.

Coverity CID 104792.

8 years agofileno might return negative.
Jarkko Hietaniemi [Mon, 22 Jun 2015 11:25:27 +0000 (07:25 -0400)]
fileno might return negative.

(Coverity CID 104853)

Also rewrite the fstat call to test for zero (success) explicitly,
instead of the sneaky bang-negation.

8 years agosleep() with negative argument makes no sense.
Jarkko Hietaniemi [Mon, 22 Jun 2015 10:50:34 +0000 (06:50 -0400)]
sleep() with negative argument makes no sense.

Give by default a warning, do not sleep, and return zero.

(the signedness problem detected by Coverity, CID 104844)

Other options would include not giving a warning at all,
giving a warning only if asked, and finally croaking.
(Python had this problem earlier, and chose croaking.)

Earlier discussion in
http://www.nntp.perl.org/group/perl.perl5.porters/2015/03/msg226304.html

See also:
http://pubs.opengroup.org/onlinepubs/9699919799/functions/sleep.html
http://linux.die.net/man/3/sleep
https://www.freebsd.org/cgi/man.cgi?query=sleep&sektion=3

8 years agoalarm() with negative argument makes no sense.
Jarkko Hietaniemi [Thu, 5 Mar 2015 12:57:14 +0000 (07:57 -0500)]
alarm() with negative argument makes no sense.

Give by default a warning, do not set the alarm, and return undef.

(the signedness problem detected by Coverity, CID 104837)

alarm() takes and returns unsigned int, not signed.

In other words, the C library function alarm() cannot fail, ever.
See for example:

http://pubs.opengroup.org/onlinepubs/9699919799/functions/alarm.html
http://linux.die.net/man/3/alarm
https://www.freebsd.org/cgi/man.cgi?query=alarm&sektion=3

8 years agoUpdate File::Spec advice in perlport.
Craig A. Berry [Fri, 26 Jun 2015 21:50:27 +0000 (16:50 -0500)]
Update File::Spec advice in perlport.

Eighteen years ago, with Mac OS Classic in full swing and Unix
emulation on VMS spotty or non-existent, it made some sense to
reach for File::Spec sooner rather than later.  This is no longer
sound advice, so attempt to describe succinctly how things
actually work now, fix the broken examples, and drop the ancient
history of the File::Spec module.

8 years agoFix Pod::Simple tests that use catdir on non-directories.
Craig A. Berry [Fri, 26 Jun 2015 20:10:18 +0000 (15:10 -0500)]
Fix Pod::Simple tests that use catdir on non-directories.

Also sent upstream as:

https://rt.cpan.org/Public/Bug/Display.html?id=105511

8 years agoCorrect t/op/chdir.t test count following b4929cb48878.
Craig A. Berry [Fri, 26 Jun 2015 12:24:30 +0000 (07:24 -0500)]
Correct t/op/chdir.t test count following b4929cb48878.

8 years agoCorrect errno value in vms/vms.c's home-grown chdir.
Craig A. Berry [Fri, 26 Jun 2015 10:41:48 +0000 (05:41 -0500)]
Correct errno value in vms/vms.c's home-grown chdir.

It appears that in 09f253ec43d3a97e7 I made a guess without
consulting the standard, which in fact specifies that ENOENT
should be set when the input path is an empty string.  We now
test for the standard behavior as of b4929cb48878718c, and this
change gets that passing again.

8 years agoRemove unused variables from t/op/chdir.t.
Craig A. Berry [Fri, 26 Jun 2015 10:39:48 +0000 (05:39 -0500)]
Remove unused variables from t/op/chdir.t.

8 years agoAdd a direct link to perldelta in the release announcement
Max Maischein [Sun, 7 Jun 2015 15:13:25 +0000 (17:13 +0200)]
Add a direct link to perldelta in the release announcement

As the release announcement itself only contains the SHA1 digests and
not much information on the changes with this release, providing
a direct link to where the information is available seems to be wanted.

8 years agomake Encode compile under -pedantic
David Mitchell [Tue, 23 Jun 2015 10:12:40 +0000 (11:12 +0100)]
make Encode compile under -pedantic

enc2xs generates some C code which contains tables. These tables contain
recursive and mutually recursive pointers to other tables. Normally they
are declared as 'static const', except under C++ which can't handle this,
so there they are declared 'extern' and defined ''.

-Wc++-compat and -pedantic put a bit of a spanner in the works.
There is an existing hack to shut up a warning with -Wc++-compat by not
including the table's size in the forward declaration, but this breaks
-pedantic.

This commit does two things to enc2xs. First it moves all the logic that
examines the build options and decides whether to use 'const' etc, into
a separate function, compiler_info().  Second, it fixes the -pedantic
compilation failure by, in the presence of both -Wc++-compat and
-pedantic, falling back to a C++-style compile without the 'static const'.

This is monkey-patching an unstream-CPAN module in core due to it failing
one of the smoke configurations.

8 years agoMake the LoTR quote of reentr.c formatted more like the others.
Jarkko Hietaniemi [Wed, 24 Jun 2015 03:33:23 +0000 (23:33 -0400)]
Make the LoTR quote of reentr.c formatted more like the others.

(Note: the p.260 is my best estimate since I don't have
 the same edition as tchrist)

8 years agofix si_names context debugging names
David Mitchell [Wed, 24 Jun 2015 07:57:41 +0000 (08:57 +0100)]
fix si_names context debugging names

I recently added a new context stack type, MULTICALL. The table
si_names[], which contains the stack type names to display with
-Dsv a new label added, "MULTICALL", but the previous label didn't
have a comma after it, so the two labels were actually being concatenated.

Spotted by Coverity

8 years agofix harmless(ish) thinko in pp_return
David Mitchell [Wed, 24 Jun 2015 07:52:14 +0000 (08:52 +0100)]
fix harmless(ish) thinko in pp_return

My recently added Move() is moving an array of SV*'s, not SV**'s.
Spotted by Coverity.

8 years agofix punctuation in Tolkien quote in regexec.c
Chas. Owens [Tue, 23 Jun 2015 12:52:45 +0000 (13:52 +0100)]
fix punctuation in Tolkien quote in regexec.c

Message-ID:
<CAH2YjjEcaHknBtb1g0jxPZAXXtkQ-7ODjWbSyioKUjxr0_NN4A@mail.gmail.com>

8 years agodo not try printing undef
Ricardo Signes [Mon, 22 Jun 2015 14:57:04 +0000 (10:57 -0400)]
do not try printing undef

8 years agoUpdate autodie to CPAN version 2.28
Chris 'BinGOs' Williams [Mon, 22 Jun 2015 12:28:06 +0000 (13:28 +0100)]
Update autodie to CPAN version 2.28

  [DELTA]

2.28      2015-06-22 16:20:35+10:00 Australia/Melbourne

        * TEST BUG: Properly skip the Import::Into test if the
          version of Import::Into is insufficent.  Thanks to
          Olivier MenguĂ©.  (GH#67)

        * DOC: Document change in 2.27 that was omitted from the
          Changes-file by mistake.

8 years agoUpdate Getopt-Long to CPAN version 2.47
Chris 'BinGOs' Williams [Mon, 22 Jun 2015 12:06:17 +0000 (13:06 +0100)]
Update Getopt-Long to CPAN version 2.47

  [DELTA]

Changes in version 2.47
-----------------------

* Fix bug https://rt.cpan.org/Ticket/Display.html?id=89513.

  Should have done that earlier :)

  This changes the format for accepted float numbers:

  <optional sign>
  <optional mantissa>
  <optional dec.point and fraction>
  <optional "e" and exponent>

  Mantissa and decimal fraction may not both be omitted.

  Underscores are permissible virtually anywhere in numbers for clarity.

8 years agoRespect hashbangs containing perl6
Leon Timmermans [Sun, 19 Apr 2015 11:03:28 +0000 (13:03 +0200)]
Respect hashbangs containing perl6

8 years agoIncrease the maximal size of the string displayed in non-numeric warnings
Rafael Garcia-Suarez [Mon, 22 Jun 2015 07:46:18 +0000 (09:46 +0200)]
Increase the maximal size of the string displayed in non-numeric warnings

This has the interesting side-effect of "fixing" some of the UTF-8
glob warnings, which indicates that sv_uni_display is probably not
dealing with stringified globs correctly.

Also add a test for the truncation of strings in the non-numeric
warnings.

8 years agoThese be the versions on CPAN now, ye scurvy dogs.
Chris 'BinGOs' Williams [Mon, 22 Jun 2015 07:25:07 +0000 (08:25 +0100)]
These be the versions on CPAN now, ye scurvy dogs.

8 years agoperlvar: fix list of defaulted array operators
Aristotle Pagaltzis [Sun, 21 Jun 2015 19:25:55 +0000 (21:25 +0200)]
perlvar: fix list of defaulted array operators

8 years agowelcome to v5.23.1, please make regen
Ricardo Signes [Sat, 20 Jun 2015 20:35:57 +0000 (16:35 -0400)]
welcome to v5.23.1, please make regen