perl.git
11 hours agoToday's M::CL is up on CPAN already blead
Steve Hay [Fri, 20 Oct 2017 23:17:00 +0000 (00:17 +0100)] 
Today's M::CL is up on CPAN already

11 hours agoPrepare Module::CoreList for 5.27.6
Steve Hay [Fri, 20 Oct 2017 23:11:33 +0000 (00:11 +0100)] 
Prepare Module::CoreList for 5.27.6

11 hours agoBump version to 5.27.6
Steve Hay [Fri, 20 Oct 2017 22:54:15 +0000 (23:54 +0100)] 
Bump version to 5.27.6

11 hours agoperldelta - Fix version for the next run of Porting/acknowledgements.pl
Steve Hay [Fri, 20 Oct 2017 22:45:38 +0000 (23:45 +0100)] 
perldelta - Fix version for the next run of Porting/acknowledgements.pl

And fix the template file so that the impending version bump will leave it
correct for next time too.

11 hours agoNew perldelta for 5.27.6
Steve Hay [Fri, 20 Oct 2017 22:41:00 +0000 (23:41 +0100)] 
New perldelta for 5.27.6

12 hours agoTick off 5.27.5
Steve Hay [Fri, 20 Oct 2017 22:27:06 +0000 (23:27 +0100)] 
Tick off 5.27.5

12 hours agoAdd epigraph for 5.27.5
Steve Hay [Fri, 20 Oct 2017 22:26:13 +0000 (23:26 +0100)] 
Add epigraph for 5.27.5

14 hours agoPerl 5.27.5 today v5.27.5
Steve Hay [Fri, 20 Oct 2017 20:20:22 +0000 (21:20 +0100)] 
Perl 5.27.5 today

14 hours agoFinalize perldelta
Steve Hay [Fri, 20 Oct 2017 20:16:59 +0000 (21:16 +0100)] 
Finalize perldelta

14 hours agoUpdate Module::CoreList for 5.27.5
Steve Hay [Fri, 20 Oct 2017 20:09:37 +0000 (21:09 +0100)] 
Update Module::CoreList for 5.27.5

14 hours agoperldelta - Fix broken links
Steve Hay [Fri, 20 Oct 2017 20:06:10 +0000 (21:06 +0100)] 
perldelta - Fix broken links

14 hours agoperldelta - Remove boilerplate
Steve Hay [Fri, 20 Oct 2017 19:52:32 +0000 (20:52 +0100)] 
perldelta - Remove boilerplate

14 hours agoperldelta - Update selected bug fixes etc
Steve Hay [Fri, 20 Oct 2017 19:47:46 +0000 (20:47 +0100)] 
perldelta - Update selected bug fixes etc

15 hours agoperldelta - Update modules
Steve Hay [Fri, 20 Oct 2017 18:45:46 +0000 (19:45 +0100)] 
perldelta - Update modules

15 hours agoSuppress spurious corelist-perldelta.pl warning
Steve Hay [Fri, 20 Oct 2017 18:45:04 +0000 (19:45 +0100)] 
Suppress spurious corelist-perldelta.pl warning

15 hours agoTeach corelist-perldelta.pl about libnet, podlators and Sub::Util
Steve Hay [Fri, 20 Oct 2017 18:43:41 +0000 (19:43 +0100)] 
Teach corelist-perldelta.pl about libnet, podlators and Sub::Util

27 hours agoPorting/Maintainers.pl - version's vxs.inc is now CUSTOMIZED as well
Steve Hay [Fri, 20 Oct 2017 07:25:35 +0000 (08:25 +0100)] 
Porting/Maintainers.pl - version's vxs.inc is now CUSTOMIZED as well

27 hours agoPorting/Maintainers.pl - NEXT is CUSTOMIZED
Steve Hay [Fri, 20 Oct 2017 07:22:33 +0000 (08:22 +0100)] 
Porting/Maintainers.pl - NEXT is CUSTOMIZED

29 hours agoDeparse.t tweak
Father Chrysostomos [Fri, 20 Oct 2017 04:35:51 +0000 (21:35 -0700)] 
Deparse.t tweak

The revert two commits ago causes B::Deparse to go through a different
code path when dumping the constant.  Ideally the output should be the
same either way (i.e., consistently with or without a semicolon, not
sometimes one way and sometimes the other).  But for now, just make
the test more lenient.

31 hours agoperldelta for 14062320f
Father Chrysostomos [Fri, 20 Oct 2017 03:14:29 +0000 (20:14 -0700)] 
perldelta for 14062320f

31 hours agoTemporarily revert CV-in-stash optimisation
Father Chrysostomos [Fri, 20 Oct 2017 01:18:37 +0000 (18:18 -0700)] 
Temporarily revert CV-in-stash optimisation

This reverts two hunks from 6881372e19 to allow CPAN modules some time
to conform to the optimisation.

41 hours agoUpdate win32/config_H.[gv]c canned configuration files
Steve Hay [Thu, 19 Oct 2017 12:55:03 +0000 (13:55 +0100)] 
Update win32/config_H.[gv]c canned configuration files

This is done using the regen_config_h targets in the Windows makefiles,
being careful to restore a couple of things otherwise lost from the
config_H.gc file (a couple of STRINGIFY #undefs, comments above the
HASATTRIBUTE_* #defines, and the #define of HAS_MKSTEMP).

The files are now in sync with the top-level master configuration file,
config_h.SH.

2 days agoUse SvLEN_set/SvCUR_set in a few extra locations
Nicolas R [Mon, 25 Sep 2017 18:37:06 +0000 (13:37 -0500)] 
Use SvLEN_set/SvCUR_set in a few extra locations

SvLEN was set without using the generic macro SvLEN_set.
Use it in three extra locations, and also use SvCUR_set
instead of SvCUR.

2 days agoMerge branch 'smoke-me/ilmari/exec-empty-argv' into blead
Dagfinn Ilmari Mannsåker [Wed, 18 Oct 2017 16:04:57 +0000 (17:04 +0100)] 
Merge branch 'smoke-me/ilmari/exec-empty-argv' into blead

2 days agoPerldelta for exec PROGRAM LIST with empty LIST
Dagfinn Ilmari Mannsåker [Wed, 18 Oct 2017 11:48:30 +0000 (12:48 +0100)] 
Perldelta for exec PROGRAM LIST with empty LIST

2 days ago[perl #131730] Fix exec PROGRAM LIST with empty LIST on VMS
Dagfinn Ilmari Mannsåker [Fri, 1 Sep 2017 11:11:53 +0000 (12:11 +0100)] 
[perl #131730] Fix exec PROGRAM LIST with empty LIST on VMS

Only when being Unixish, because I have no idea if
setup_argstr()/vms_do_exec() handle it.

2 days ago[perl #131730] Fix exec PROGRAM LIST with empty LIST
Dagfinn Ilmari Mannsåker [Sat, 22 Jul 2017 18:32:40 +0000 (19:32 +0100)] 
[perl #131730] Fix exec PROGRAM LIST with empty LIST

This should call execvp() with an empty argv array (containing only the
terminating NULL pointer), but was instead just returning false (and not
setting $!).

Executing a program with an empty argv array is valid ISO C: it merely
requires argc to be nonnegative and argv[argc] to be NULL.  POSIX states
that that argv[0] "should point to a filename string that is associated
with the process being started", but "should" only applies to
applications claiming strict POSIX conformance.  Perl does not, and
certainly should not impose it on perl programs.

This also requires handling the case where both PROGRAM and LIST are
empty, to avoid calling execvp(NULL, …), which _is_ invalid.  I've made
it return ENOENT, which it the error POSIX specifies for execvp("", …).

3 days agoUpgrade Test-Simple from version 1.302101 to 1.302103
Steve Hay [Wed, 18 Oct 2017 07:29:16 +0000 (08:29 +0100)] 
Upgrade Test-Simple from version 1.302101 to 1.302103

4 days agothe unopened test should use a file handle distinct from "OTHER"
Tony Cook [Tue, 17 Oct 2017 03:39:44 +0000 (14:39 +1100)] 
the unopened test should use a file handle distinct from "OTHER"

used a name and added a comment so this isn't broken again

4 days ago[perl #127063] suppress warning on assigning 0 to $[
Tony Cook [Mon, 4 Jan 2016 00:13:19 +0000 (11:13 +1100)] 
[perl #127063] suppress warning on assigning 0 to $[

4 days agoPERL5LIB documentation: '.' is no longer in @INC by default
Lukas Mai [Mon, 16 Oct 2017 20:39:45 +0000 (22:39 +0200)] 
PERL5LIB documentation: '.' is no longer in @INC by default

4 days agocustomise Pod::Perldoc to fix output misbehaviour
Zefram [Sat, 7 Oct 2017 04:17:19 +0000 (05:17 +0100)] 
customise Pod::Perldoc to fix output misbehaviour

Pod::Perldoc has, since version 3.20, exhibited various kinds of
misbehaviour relating to a bad default choice of formatter.  Output has
sometimes appeared mangled due to the newly-default formatter emitting
unportable escape sequences, and sometimes there has been a more
severe output failure due to perldoc making unportable changes to pager
configuration in an attempt to make the escape sequences work.  This is
discussed in [perl #131762].  In the upstream instance of the module
there have been tweaks to the unportable behaviour, but not an actual fix.

In order to make the core distro ship a reliably-working version of
perldoc, this patch customises Pod::Perldoc to implement the obvious
fix for the portability problems.  The fixed version defaults to the
ToText formatter, which produces properly plain text that will go through
any pager.  It never attempts any change to pager configuration.

5 days ago[perl #124349] deprecation warning on hostname() with arguments
Tony Cook [Tue, 17 Nov 2015 00:56:12 +0000 (11:56 +1100)] 
[perl #124349] deprecation warning on hostname() with arguments

5 days agoUse preprocessor check for some DEBUG_X_TEST
Nicolas R [Mon, 25 Sep 2017 17:18:28 +0000 (12:18 -0500)] 
Use preprocessor check for some DEBUG_X_TEST

Most of the DEBUG_?_TEST calls are already protected
by one '#idef DEBUGGING' check, but noticed a few of them
which were not protected in sv.c and toke.c

We should avoid these extra 'if' statements if perl
is not compiled with debug option: -DDEBUGGING.

5 days ago(perl #131982) update the set/getpriority documentation too
Tony Cook [Wed, 27 Sep 2017 05:27:14 +0000 (15:27 +1000)] 
(perl #131982) update the set/getpriority documentation too

5 days ago(perl #131982) provide constants for get/setpriority in POSIX.pm
Tony Cook [Wed, 27 Sep 2017 05:18:17 +0000 (15:18 +1000)] 
(perl #131982) provide constants for get/setpriority in POSIX.pm

<sys/time.h> isn't necessarily needed, but apparently increases
portability, since the rusage structure defined in <sys/resource.h>
has struct timeval members.

5 days agoDocument that POSIX::abs, ::alarm, ::atan2, ::chdir, ::chmod need explicit argument.
James E Keenan [Thu, 28 Sep 2017 00:34:09 +0000 (20:34 -0400)] 
Document that POSIX::abs, ::alarm, ::atan2, ::chdir, ::chmod need explicit argument.

Reformat code in one foreach block for readability.  Make podcheck happy.

For: RT #132145

6 days agopp.c: delete dead cpp-conditional declaration
Aaron Crane [Sun, 15 Oct 2017 10:01:08 +0000 (12:01 +0200)] 
pp.c: delete dead cpp-conditional declaration

This was added in commit dfe9444ca7881e716e9e8feaf20b55da491363ca (February
1998, for Perl 5.004_60) by Andy Dougherty, and its comment says that, even
then, he thought it was unneeded. But the perl5 repo has ever defined the
NEED_GETPID_PROTO cpp symbol that guards this declaration, so this ability
has clearly never been used.

6 days agoRemove out-of-date mention of USA president
Smylers [Thu, 12 Oct 2017 13:18:40 +0000 (14:18 +0100)] 
Remove out-of-date mention of USA president

Avoid having to continue to update this every time the president changes
by replacing Barack Obama with Ada Lovelace.

6 days agoRT#131000: splice doesn't honour read-only flag
Aaron Crane [Thu, 16 Mar 2017 12:33:59 +0000 (12:33 +0000)] 
RT#131000: splice doesn't honour read-only flag

The push and unshift builtins were correctly throwing a "Modification of a
read-only value attempted" exception when modifying a read-only array, but
splice was silently modifying the array. This commit adds tests that all
three builtins throw such an exception.

One discrepancy between the three remains: push has long silently accepted
a push of no elements onto an array, whereas unshift throws an exception in
that situation. This seems to have been originally a coincidence. The
pp_unshift implementation first makes space for the elements it unshifts
(which croaks for a read-only array), then copies the new values into the
space thus created. The pp_push implementation, on the other hand, calls
av_push() individually on each element; that implicitly croaks, but only one
there's at least one element being pushed.

The pp_push implementation has subsequently been changed: read-only checking
is now done first, but that was done to fix a memory leak. (If the av_push()
itself failed, then the new SV that had been allocated for pushing onto the
array would get leaked.) That leak fix specifically grandfathered in the
acceptance of empty-push-to-readonly-array, to avoid changing behaviour.

I'm not fond of the inconsistency betwen push on the one hand and unshift &
splice on the other, but I'm disinclined to make empty-push-to-readonly
suddenly start throwing an exception after all these years, and it seems
best not to extend that exemption-from-exception to the other builtins.

6 days agoUse library functions instead of manual TAP in t/io/tell.t.
Dmitry Ulanov [Fri, 13 Oct 2017 15:14:49 +0000 (17:14 +0200)] 
Use library functions instead of manual TAP in t/io/tell.t.

Committer: minor corrections to descriptions.

Dmitry Ulanov is now a Perl author.

For: RT #132276

6 days agohints/aix.sh: remove trailing spaces
Lukas Mai [Sat, 14 Oct 2017 16:03:17 +0000 (18:03 +0200)] 
hints/aix.sh: remove trailing spaces

6 days agominiperl also needs -Ilib for perl.exp on AIX etc
H.Merijn Brand [Sat, 14 Oct 2017 15:01:40 +0000 (17:01 +0200)] 
miniperl also needs -Ilib for perl.exp on AIX etc

6 days agoDocument that -I. is now needed with -MTestInit
Dominic Hargreaves [Sat, 14 Oct 2017 14:19:51 +0000 (16:19 +0200)] 
Document that -I. is now needed with -MTestInit

6 days agog++ is like gcc on AIX too
H.Merijn Brand [Sat, 14 Oct 2017 13:55:08 +0000 (15:55 +0200)] 
g++ is like gcc on AIX too

note that we cannot use g*, as AIX/vac ships gxlc as xlc with gcc-like
option handling

6 days agodelete unused file from SDBM_File
Lukas Mai [Sat, 14 Oct 2017 12:45:41 +0000 (14:45 +0200)] 
delete unused file from SDBM_File

6 days agoget rid of "implicit fallthrough" warnings in SDBM_File
Lukas Mai [Sat, 14 Oct 2017 12:42:20 +0000 (14:42 +0200)] 
get rid of "implicit fallthrough" warnings in SDBM_File

6 days agoSDBM_File: tabs -> spaces
Lukas Mai [Sat, 14 Oct 2017 12:39:36 +0000 (14:39 +0200)] 
SDBM_File: tabs -> spaces

6 days agoDelete dead mktemp() call
Aaron Crane [Sat, 14 Oct 2017 12:56:23 +0000 (14:56 +0200)] 
Delete dead mktemp() call

Commit 9c12f1e5a87cce227357eea4b0780c0323f952f0 provided support for Cray
XT4 Catamount/Qk. It added some code with a call to (insecure) mktemp(),
guarded with "#ifdef HAS_MKTEMP". But nothing has ever attempted to define
that preprocessor symbol (including the hints file that was added in that
commit), so this is clearly unused.

6 days agofix comment on GCC_DIAG_IGNORE/GCC_DIAG_RESTORE
Lukas Mai [Sat, 14 Oct 2017 12:24:02 +0000 (14:24 +0200)] 
fix comment on GCC_DIAG_IGNORE/GCC_DIAG_RESTORE

6 days agoactually fix "implicit fallthrough" warnings in gcc 7
Lukas Mai [Sat, 14 Oct 2017 12:21:25 +0000 (14:21 +0200)] 
actually fix "implicit fallthrough" warnings in gcc 7

6 days agoremove the GCC_DIAG_RESTORE pragma as well
Yves Orton [Sat, 14 Oct 2017 12:06:20 +0000 (14:06 +0200)] 
remove the GCC_DIAG_RESTORE pragma as well

6 days agoremove GCC_DIAG_IGNORE from sbox32_hash.h
Yves Orton [Sat, 14 Oct 2017 11:55:53 +0000 (13:55 +0200)] 
remove GCC_DIAG_IGNORE from sbox32_hash.h

6 days agofixups for portability
Yves Orton [Sat, 14 Oct 2017 11:42:47 +0000 (13:42 +0200)] 
fixups for portability

a) some platforms want #define to start at col 0
b) some compilers want to know whether fallthrough is expected or not.

6 days agoDelete unused files from ext/SDBM_File
Aaron Crane [Sat, 14 Oct 2017 10:42:20 +0000 (12:42 +0200)] 
Delete unused files from ext/SDBM_File

7 days agoskip bench.t if valgrind is installed but broken
Lukas Mai [Fri, 13 Oct 2017 21:22:11 +0000 (23:22 +0200)] 
skip bench.t if valgrind is installed but broken

7 days agouse standard STMT_START/STMT_END macros in STATIC_ASSERT_STMT
Lukas Mai [Fri, 13 Oct 2017 20:58:40 +0000 (22:58 +0200)] 
use standard STMT_START/STMT_END macros in STATIC_ASSERT_STMT

7 days agoavoid gcc 7 warning about * in boolean context
Lukas Mai [Fri, 13 Oct 2017 20:34:25 +0000 (22:34 +0200)] 
avoid gcc 7 warning about * in boolean context

7 days agoget rid of "implicit fallthrough" warnings in ext/re/re_exec.c
Lukas Mai [Fri, 13 Oct 2017 20:16:30 +0000 (22:16 +0200)] 
get rid of "implicit fallthrough" warnings in ext/re/re_exec.c

7 days agoget rid of "implicit fallthrough" warnings with gcc 7
Lukas Mai [Fri, 13 Oct 2017 17:50:24 +0000 (19:50 +0200)] 
get rid of "implicit fallthrough" warnings with gcc 7

7 days agoFix typo in comment about Configure modification
Dominic Hargreaves [Fri, 13 Oct 2017 14:31:03 +0000 (16:31 +0200)] 
Fix typo in comment about Configure modification

7 days agoClarify policy on updates to Configure
Dominic Hargreaves [Fri, 13 Oct 2017 14:16:51 +0000 (16:16 +0200)] 
Clarify policy on updates to Configure

7 days agoFurther metaconfig updates to Porting/pumpkin.pod
Dominic Hargreaves [Fri, 13 Oct 2017 13:01:32 +0000 (15:01 +0200)] 
Further metaconfig updates to Porting/pumpkin.pod

7 days agoAdd Porting/mksample
Dominic Hargreaves [Fri, 13 Oct 2017 12:49:03 +0000 (14:49 +0200)] 
Add Porting/mksample

This script was previously in the metaconfig repository, and also dealt
with updating Porting/Glossary, but it wasn't being regularly used.
It does not use any data from that repository, so is better placed
here.

There are some outstanding ambiguities to resolve in when this script
should be run in the documentation, since the generated files
Porting/config.sh and Porting/config_H are also updated by other
means.

7 days agoActually test for memrchr in VMS
H.Merijn Brand [Fri, 13 Oct 2017 13:01:56 +0000 (15:01 +0200)] 
Actually test for memrchr in VMS

7 days agoUpdate Config-Perl-V to CPAN version 0.29
Chris 'BinGOs' Williams [Fri, 13 Oct 2017 12:25:29 +0000 (13:25 +0100)] 
Update Config-Perl-V to CPAN version 0.29

  [DELTA]

0.29  - 12 Oct 2017, H.Merijn Brand
    * It's 2017
    * Add test for 5.26.1-RC1
    * Fix signature with argument
    * Ignore ccache and compiler path in signature

7 days agoFinish adding memrchr Configure probe
Dagfinn Ilmari Mannsåker [Fri, 13 Oct 2017 12:40:09 +0000 (14:40 +0200)] 
Finish adding memrchr Configure probe

Commit 1e436e33 accidentally added the probe to Configure, this finishes
the job by regenerating Glossary, config_h.SH and friends.

7 days agoStrip ccache from $Config{cc}
H.Merijn Brand [Fri, 13 Oct 2017 11:56:47 +0000 (13:56 +0200)] 
Strip ccache from $Config{cc}

When building with -Dcc="ccache cc", $Config{cc} would also end up with
this setting. If that perl is then distributed, no XS will be able to
build if the target machine has no ccache installed/available

With this change, the whole build of perl itself will use ccache, but
$Config{cc} will have it stripped, so all modules (lib/cpan/ext) will
not use ccache. A correct installation of ccache however does not need
$CC to include the ccache prefix, so it is essentially a setup problem
on the building host.

8 days agofix comment for upstream meta
H.Merijn Brand [Fri, 13 Oct 2017 09:25:03 +0000 (11:25 +0200)] 
fix comment for upstream meta

8 days agoUpdate metaconfig related information
H.Merijn Brand [Fri, 13 Oct 2017 09:20:12 +0000 (11:20 +0200)] 
Update metaconfig related information

8 days agoUpgrade Test-Simple from version 1.302100 to 1.302101
Steve Hay [Fri, 13 Oct 2017 07:18:23 +0000 (08:18 +0100)] 
Upgrade Test-Simple from version 1.302100 to 1.302101

8 days agohopefully better macros for building on x86
Yves Orton [Thu, 12 Oct 2017 15:57:21 +0000 (17:57 +0200)] 
hopefully better macros for building on x86

9 days agoperl no longer builds on MacOS Classic
Tom Hukins [Wed, 11 Oct 2017 19:37:02 +0000 (19:37 +0000)] 
perl no longer builds on MacOS Classic

9 days agoUpgrade Test-Simple from vesion 1.302098 to 1.302100
Steve Hay [Thu, 12 Oct 2017 07:22:40 +0000 (08:22 +0100)] 
Upgrade Test-Simple from vesion 1.302098 to 1.302100

11 days agoUpgrade Encode from version 2.92 to 2.93
Steve Hay [Tue, 10 Oct 2017 07:30:01 +0000 (08:30 +0100)] 
Upgrade Encode from version 2.92 to 2.93

11 days agoEliminate recently introduced compilation warnings.
James E Keenan [Mon, 9 Oct 2017 11:42:02 +0000 (13:42 +0200)] 
Eliminate recently introduced compilation warnings.

Warnings like the following started to appear within last 24 hours while
running 'make' on Linux/gcc and FreeBSD-10.3/clang.

op.c: In function ‘Perl_newATTRSUB_x’:
op.c:8593:28: warning: suggest parentheses around ‘&&’ within ‘||’
[-Wparentheses]
        :   IN_PERL_RUNTIME && PL_curstash != CopSTASH(PL_curcop)

12 days agoIncrease B::Xref::VERSION to 1.07
Father Chrysostomos [Mon, 9 Oct 2017 05:23:38 +0000 (22:23 -0700)] 
Increase B::Xref::VERSION to 1.07

12 days agoFix B::Xref to handle sub refs
Father Chrysostomos [Mon, 9 Oct 2017 05:22:30 +0000 (22:22 -0700)] 
Fix B::Xref to handle sub refs

This only applies to non-threaded builds.  Threaded builds were
already fine.

12 days agoB: Really remove unused var
Father Chrysostomos [Sun, 8 Oct 2017 22:58:01 +0000 (15:58 -0700)] 
B: Really remove unused var

6a4fc5265ba102 removed the useless assignment to it, but not the
var itself.

12 days ago[Merge] [perl #129916] Allow sub-in-stash outside of main
Father Chrysostomos [Sun, 8 Oct 2017 21:54:13 +0000 (14:54 -0700)] 
[Merge] [perl #129916] Allow sub-in-stash outside of main

The sub-in-stash optimization introduced in 2eaf799e only applied to
subs in the main stash, not in other stashes, due to a problem with
the logic in newATTRSUB.

This branch includes various commits to fix the issue and other prob-
lems that the fix uncovered.

12 days agoMake pp_multideref handle local $::{subref}
Father Chrysostomos [Sun, 24 Sep 2017 23:48:48 +0000 (16:48 -0700)] 
Make pp_multideref handle local $::{subref}

Based on a patch by Nicholas R.

12 days ago[perl #129916] Allow sub-in-stash outside of main
Father Chrysostomos [Thu, 21 Sep 2017 14:06:05 +0000 (07:06 -0700)] 
[perl #129916] Allow sub-in-stash outside of main

The sub-in-stash optimization introduced in 2eaf799e only applied to
subs in the main stash, not in other stashes, due to a problem with
the logic in newATTRSUB.

This comment:

   Also, we may be called from load_module at run time, so
   PL_curstash (which sets CvSTASH) may not point to the stash the
   sub is stored in.

explains why we need the PL_curstash != CopSTASH(PL_curcop) check.
(Perl_load_module will fail without it.) But that logic does not work
properly at compile time (when PL_curcop == &PL_compiling).

The value of CopSTASH(&PL_compiling) is never actually used.  It is
always set to the main stash.  So if we check that PL_curstash !=
CopSTASH(PL_curcop) and forego the optimization in that case, we will
never optimize subs outside of the main stash.

What we really need is to check IN_PERL_RUNTIME && PL_curstash !=
opSTASH(PL_curcop).  I.e., forego the optimization at run time if the
stashes differ.  That is what this commit implements.

One observable side effect of this change is that deleting a stash
element no longer anonymizes the CV if the CV had no GV that it was
depending on to provide its name.  Since the main thing in such situa-
tions is that we do not get a crash, I think this change (arguably an
improvement) is acceptable.)

-----------

A bit of explanation of various other changes:

gv.c:require_tie_mod needed a bit of help, since it could not handle
sub refs in stashes.

To keep localisation of stash elements working the same way,
local($Stash::{foo}) now upgrades a coderef to a full GV before the
localisation.  (Changes in two pp*.c files and in scope.c:save_gp.)

t/op/stash.t contains a test that makes sure that perl does not crash
when a GV with a CV pointing to it gets deleted.  This commit tweaks
the test so that it continues to test that.  (There has to be a GV for
the test to test what it is meant to test.)

Similarly with t/uni/caller.t and t/uni/stash.t.

op.c:rv2cv_op_cv with the _MAYBE_NAME_GV flag was returning the cal-
ling GV in those cases where a GV-less sub is called via a GV.  E.g.,
*main = \&Foo::foo; main().  This meant that errors like ‘Not enough
arguments’ were giving the wrong sub name.

newATTRSUB was not calling mro_method_changed_in when storing a
sub as an RV.

gv_init needs to arrange for the new GV to have the file and line num-
ber corresponding to the sub in it.  These are taken from CvSTART,
which may be off by a few lines, but is the closest we have to the
place the sub was declared.

12 days agoIncrease $B::Deparse::VERSION to 1.43
Father Chrysostomos [Sun, 24 Sep 2017 21:15:01 +0000 (14:15 -0700)] 
Increase $B::Deparse::VERSION to 1.43

12 days agoDeparse: Better constant-dumping heuristics
Father Chrysostomos [Sun, 24 Sep 2017 21:14:00 +0000 (14:14 -0700)] 
Deparse: Better constant-dumping heuristics

Constants created via sub foo () { 1 } are stored in the stash as
simple scalar references, under the CV-in-stash optimisation.  That
optimisation currently only applies to the main package, but will
shortly be extended to other packages.  This means B::Deparse’s
heuristics for dumping the constants needs to be improved, to avoid
dumping B::Deparse’s own constants for every program.

The heuristic I am using (since CvFILE is not present on a scalar ref)
is to record whether other subroutines in the same package as the con-
stant are being dumped by virtue of having CvFILE pointing to a file
that is being dumped.  This assumption is that constants and subroutines
in the same package are likely to be in the same file.

12 days agoProvisional version bump for NEXT.pm
Father Chrysostomos [Mon, 11 Sep 2017 04:51:50 +0000 (21:51 -0700)] 
Provisional version bump for NEXT.pm

A patch ha- been submitted upstream already, so hopefully this version
number will be short-lived.

12 days agoIncrease B::Concise::VERSION to 1.002
Father Chrysostomos [Mon, 11 Sep 2017 04:49:14 +0000 (21:49 -0700)] 
Increase B::Concise::VERSION to 1.002

12 days agoMake B::Concise handle subrefs in stashes
Father Chrysostomos [Mon, 11 Sep 2017 04:46:41 +0000 (21:46 -0700)] 
Make B::Concise handle subrefs in stashes

The concise_stashref sub, for dumping all subroutines in a package,
would assign the value of a stash element to *s, and then use *s
to access the code ref in it.  If you do *s = *foo and then later
*s = \&bar, then you have assigned \&bar to *foo{CODE}, and even
a localisation of *s beforehand will not help.  That is exactly
what B::Concise was doing when dumping a package with some subref
elements.

12 days ago[rt.cpan.org #123002] Fix NEXT.pm to work with GLOB stubs
Father Chrysostomos [Sun, 10 Sep 2017 20:59:47 +0000 (13:59 -0700)] 
[rt.cpan.org #123002] Fix NEXT.pm to work with GLOB stubs

I need this in order to fix perl bug #129916.

12 days agoAdd isGV_or_RVCV macro
Father Chrysostomos [Sun, 3 Sep 2017 18:12:11 +0000 (11:12 -0700)] 
Add isGV_or_RVCV macro

This will be useful for a few code paths that need to treat a sub
ref in a stash the same way as a GV.

12 days agoLet Deparse.t be run from the top-level
Father Chrysostomos [Sun, 17 Sep 2017 18:18:15 +0000 (11:18 -0700)] 
Let Deparse.t be run from the top-level

It used to work before 851f7bb3.  It is helpful when debugging tests
to be able to run ‘./perl -Ilib lib/B/Deparse.t’ without chdir-
ring around.

12 days agoUnbreak gv_fetchmeth_sv
Father Chrysostomos [Sun, 17 Sep 2017 18:10:11 +0000 (11:10 -0700)] 
Unbreak gv_fetchmeth_sv

Commit v5.21.6-383-gc290e18 stopped gv_fetchmeth_sv from working cor-
rectly when fetching a constant with a utf8 name, because it no longer
passed the utf8 flag to the underlying functions.

That utf8 flag gets passed to gv_init when upgrading a glob proxy
(such as a constant) into a real glob.

12 days agoIncrease $B::VERSION to 1.70
Father Chrysostomos [Mon, 11 Sep 2017 05:13:48 +0000 (22:13 -0700)] 
Increase $B::VERSION to 1.70

12 days agoB.pm: Remove unused var
Father Chrysostomos [Mon, 11 Sep 2017 05:12:50 +0000 (22:12 -0700)] 
B.pm: Remove unused var

This variable stopped being used in perl-5.005_02-1108-g8bac7e0 but
continued to exist until now.

12 days agoDon’t assign PL_curstash twice in init_main_stash
Father Chrysostomos [Mon, 28 Aug 2017 19:52:10 +0000 (12:52 -0700)] 
Don’t assign PL_curstash twice in init_main_stash

This commit:

commit 8990e3071044a96302560bbdb5706f3e74cf1bef
Author: Larry Wall <larry@netlabs.com>
Date:   Fri Mar 18 00:00:00 1994 +0000

    perl 5.0 alpha 6

added ‘curstash = defstash’ to perl.c:init_main_stash, which already
had such an assignment a few lines above.  So it is redundant, and
always has been.

12 days agoSet PL_curstname in pp_ctl.c:doeval
Father Chrysostomos [Mon, 28 Aug 2017 19:40:58 +0000 (12:40 -0700)] 
Set PL_curstname in pp_ctl.c:doeval

Otherwise we get the wrong name in sub error and warning messages:

$ ./miniperl -we 'package bar { sub bar { eval q"sub foo ([)" } } bar::bar'
Missing ']' in prototype for main::foo : [ at (eval 1) line 1.

(PL_curstname is probably used for other things too.  I didn’t check.)

I can arbitrarily set the package name in the warning to what-
ever I want:

$ ./miniperl -we 'package bar { sub bar { eval q"sub foo ([)" } } package fwipm; BEGIN { bar::bar }'
Missing ']' in prototype for fwipm::foo : [ at (eval 1) line 1.

13 days agoMove PERL_INTERNAL_RAND_SEED set-up after init_stacks().
Craig A. Berry [Sat, 7 Oct 2017 18:31:29 +0000 (13:31 -0500)] 
Move PERL_INTERNAL_RAND_SEED set-up after init_stacks().

This code may be calling things that put SVs on the stack, so
we should have a stack before doing so.  That risk might be
theoretical on most platforms, but on VMS, the getenv
implementation mortalizes an SV when doing lookups.  This meant
that on a DEBUGGING build with PERL_DESTRUCT_LEVEL set, any code
or no code at all would warn like so:

  $ perl -e ";"
  Attempt to free temp prematurely: SV 0x845718 during global destruction.
  Scalars leaked: 1

Getting the stack initialized first fixes that.

2 weeks agoUpdate Test-Simple to CPAN version 1.302098
Chris 'BinGOs' Williams [Thu, 5 Oct 2017 12:35:08 +0000 (13:35 +0100)] 
Update Test-Simple to CPAN version 1.302098

  [DELTA]

1.302098  2017-10-03 06:13:49-07:00 America/Los_Angeles

    - Add docs for test2_stdout and test2_stderr
    - Fix 5.6 support

2 weeks agoUpdate Digest-SHA to CPAN version 5.98
Chris 'BinGOs' Williams [Thu, 5 Oct 2017 12:32:45 +0000 (13:32 +0100)] 
Update Digest-SHA to CPAN version 5.98

  [DELTA]

5.98  Wed Oct  4 00:40:02 MST 2017
  - removed "portable" mode from shasum and addfile
    -- rarely used, mostly in outdated systems
    -- potentially confusing features (e.g. \r\r\n -> \n)
    -- Universal Newlines mode (-U) a much cleaner approach
      -- mimics Universal Newlines in Python
  - shasum now uses Digest::SHA explicitly
    -- no longer loads Digest::SHA::PurePerl as an option
      -- hence no need for -R switch
    -- Digest::SHA::PurePerl has its own shasum: shasumpp

2 weeks agoperldelta for 0cbfaef69bb7
Tony Cook [Wed, 4 Oct 2017 22:39:17 +0000 (09:39 +1100)] 
perldelta for 0cbfaef69bb7

2 weeks agopp_require: return earlier when module is already loaded
Nicolas R [Tue, 26 Sep 2017 23:07:47 +0000 (18:07 -0500)] 
pp_require: return earlier when module is already loaded