Gerard Goossen [Tue, 9 Aug 2011 18:52:34 +0000 (20:52 +0200)]
Include name of global scalars in unitialized value warnings when the peephole optimiser isn't applied.
When the peephole optimiser isn't applied warnings about uninitialised
values from global scalars don't include the name of variable, because
the OP_RV2SV + OP_GV isn't converted to OP_GVSV. This patch fixes that
by extracting the name of the variable from the OP_RV2SV + OP_GV.
Father Chrysostomos [Sat, 3 Sep 2011 17:44:24 +0000 (10:44 -0700)]
Call get-magic once for CV-to-GV assignment
pp_rv2gv has already called get-magic, so pp_sassign should not do
it at all.
This is a regression from 5.8.8.
Jerry D. Hedden [Sat, 3 Sep 2011 15:10:43 +0000 (11:10 -0400)]
Upgrade to threads::shared 1.39
Jerry D. Hedden [Sat, 3 Sep 2011 15:05:08 +0000 (11:05 -0400)]
Upgrade to threads 1.85
Craig A. Berry [Sat, 3 Sep 2011 02:47:00 +0000 (21:47 -0500)]
perldelta entry for File:Glob / CVE-2011-2728 fix.
Craig A. Berry [Fri, 19 Aug 2011 15:14:13 +0000 (10:14 -0500)]
Plug segfault in bsd_glob() with unsupported ALTDIRFUNC flag.
First, disable all the unsupported flags just to make sure they aren't
triggering something they shouldn't be. Also, zero the pglob struct
before passing to bsd_glob(); it contains function pointers, and it's
safest if they are null rather than containing random stack data.
Bug reported by Clément Lecigne <clemun@gmail.com>.
Father Chrysostomos [Sat, 3 Sep 2011 05:03:06 +0000 (22:03 -0700)]
Bump threads(::shared) versions again
Since these numbers have already been used for developement releases,
they need to be changed again. I also added a note to make sure they
no longer get out of sync with the pod.
Jerry D. Hedden [Sat, 3 Sep 2011 03:28:00 +0000 (23:28 -0400)]
Upgrade to threads 1.84
Jerry D. Hedden [Sat, 3 Sep 2011 02:43:57 +0000 (22:43 -0400)]
Upgrade to threads::shared 1.38
Peter John Acklam [Fri, 2 Sep 2011 20:00:36 +0000 (13:00 -0700)]
[perl #98280] Use same version number 1.997 in all .pm files.
- For simplicity, use same version number 1.997 in all .pm files to match the
upcoming release 1.997 of the Math-BigInt distribution.
Karl Williamson [Fri, 2 Sep 2011 18:27:43 +0000 (12:27 -0600)]
perluniprops: Add note about 'L_' being non-standard
Karl Williamson [Fri, 2 Sep 2011 16:47:49 +0000 (10:47 -0600)]
utf8_heavy: Correctly handle \p{L_}
L_ is an old, discouraged but not deprecated, synonym for LC, cased
letters. It was improperly being converted to simply L, all letters,
because it is supposed to match loosely, and the trailing underscore was
being stripped. It needs a special case.
Tests passed for this, as the machine generated test case happened to
choose code points that are in both L and LC. Also some tests were
testing L instead of LC because of a similar flaw.
Karl Williamson [Fri, 2 Sep 2011 16:43:21 +0000 (10:43 -0600)]
perluniprops: display 2 synonyms as being discouraged
mktables was getting the display status from the overarching table,
instead of the synonym, for display in perluniprops.
Karl Williamson [Sun, 28 Aug 2011 18:52:49 +0000 (12:52 -0600)]
Unicode::UCD: clarify pod
Add a note, and reflow, that the data structure returned by this
function is unnecessarily complex, but is for compatibility with other
returns that need the complexity.
Karl Williamson [Sun, 28 Aug 2011 18:50:47 +0000 (12:50 -0600)]
Unicode::UCD: fix pod verbatim line length
Karl Williamson [Sun, 28 Aug 2011 18:40:37 +0000 (12:40 -0600)]
Unicode::UCD: speed up some look ups
A previous commit created the possibility that for a data structure to
be used instead of an array of arrays. The latter data structure is
used because most properties have long ranges in which each code point
maps to the same thing, and so don't have to have a hash entry for each
code point, can use the range as the base data structure. However
certain properties (or property-like structures) don't have long ranges,
and hence don't need to save memory by having things work through ranges
instead of individual code points. For these, a hash offers improved
speed, without the memory cost.
This patch converts 4 of the data structures to hashes. Future
extensions to this module will also take advantage of some of these
being in hashes
Karl Williamson [Sun, 28 Aug 2011 18:36:45 +0000 (12:36 -0600)]
Unicode::UCD: Allow for some look-up speed up
This changes the internal function to have an optional parameter to
return a hash instead of an array when the caller determines that it is
better to use a hash.
Karl Williamson [Sun, 28 Aug 2011 18:23:36 +0000 (12:23 -0600)]
Unicode::UCD: Use NFD(), not NFKD() for Hangul syllables
These decompositions are all canonical, not compatible only, so it gives
the same result, and I think it's clearer, explained in the revised
comment.
Karl Williamson [Sun, 28 Aug 2011 18:16:13 +0000 (12:16 -0600)]
Unicode::UCD Add synopsis info for num() to pod
Karl Williamson [Sun, 28 Aug 2011 18:08:04 +0000 (12:08 -0600)]
Unicode::UCD: Make pod header consistent
All the other function headers in this pod look like what this patch
makes this one look like. Corresponding links to it are also revised.
Nicholas Clark [Fri, 2 Sep 2011 11:47:57 +0000 (13:47 +0200)]
Remove Porting/genlog, redundant since the switch from Perforce to git.
"Generate a nice changelist by querying perforce" isn't much use these days.
Father Chrysostomos [Fri, 2 Sep 2011 04:26:24 +0000 (21:26 -0700)]
Silence two compiler warnings in gv.c
Father Chrysostomos [Thu, 1 Sep 2011 23:16:32 +0000 (16:16 -0700)]
Fix two \&$tied regressions
If the tied variable holds a reference, but changes to something else
when FETCH is called, perl crashes, as of commit
9d0f7ed75
(5.10.1/5.12.0):
sub ::72 { 73 };
sub TIESCALAR {bless[]}
sub STORE{}
sub FETCH { 72 }
tie my $x, "main";
$x = \$y;
\&$x;
That’s because commit
7a5fd60d4 caused double magic for one branch of
an if/else chain in sv_2cv (by using gv_fetchsv), so commit
9d0f7ed75
removed the SvGETMAGIC preceding the if/else, putting it inside each
branch. That meant that the type would be checked before get-magic
was called. So the type could change unexpectedly.
Due to another bug, this did not affect globs returned from tied array
elements, which got stringified, and hence worked in sv_2cv. But that
bug was fixed in 5.14.0 by commit
13be902ce, which allowed typeglobs
to be returned unflattened through elements of tied aggregates, caus-
ing this to stop working (‘Not a CODE reference’ instead of 73):
sub ::72 { 73 };
sub TIEARRAY {bless[]}
sub STORE{}
sub FETCH { 72 }
tie my @x, "main";
my $elem = \$x[0];
$$elem = *bar;
print &{\&$$elem}, "\n";
This commit fixes both issues by putting the SvGETMAGIC call
back where it belongs, above the if/else chain, and by using
SvPV_nomg_const and gv_fetchpvn_flags instead of gv_fetchsv, to avoid
an extra magic call.
Peter John Acklam [Thu, 1 Sep 2011 21:04:05 +0000 (14:04 -0700)]
[perl #98256] Add POD for the bsgn() method.
This stops Pod::Coverage (and possibly users)
from complaining about missing documentation.
Father Chrysostomos [Thu, 1 Sep 2011 20:57:21 +0000 (13:57 -0700)]
regen known_pod_issues.dat
Father Chrysostomos [Thu, 1 Sep 2011 20:52:05 +0000 (13:52 -0700)]
Bump Math::Big(In|Floa)t versions
Alexandr Ciornii [Thu, 1 Sep 2011 18:43:11 +0000 (21:43 +0300)]
remove incorrect formatting inside verbatim paragraphs
Alexandr Ciornii [Thu, 1 Sep 2011 17:59:17 +0000 (20:59 +0300)]
Correct links to sections (and modules in case of BigFloat.pm)
Nicholas Clark [Thu, 1 Sep 2011 21:00:32 +0000 (23:00 +0200)]
Reinstate the perldelta entry for CPANPLUS.
This was accidentally removed by commit
7ac26854bd1fc3c6. Oops.
Nicholas Clark [Thu, 1 Sep 2011 20:49:42 +0000 (22:49 +0200)]
Update AnyDBM_File's documentation to avoid use POSIX;
use Fcntl; is a much more efficient way to load the two constants needed.
Bring the joy of strict (and warnings) to AnyDBM_File, remove commented-out
code, and add __END__ to make it clear that there is no more code hiding
beyond the pod.
Father Chrysostomos [Thu, 1 Sep 2011 19:52:06 +0000 (12:52 -0700)]
Defenestrate PAD_DUP
It has been unused in core since
d5b1589c and is not used on CPAN.
Nicholas Clark [Thu, 1 Sep 2011 20:27:55 +0000 (22:27 +0200)]
Merge the POSIX.pm refactoring into blead.
POSIX.pm no longer uses AutoLoader, and is roughly halved in size, with no
change in functionality. Test coverage is improved.
Nicholas Clark [Thu, 1 Sep 2011 20:26:27 +0000 (22:26 +0200)]
Note the refactoring of POSIX.pm in perldelta.
Nicholas Clark [Thu, 1 Sep 2011 19:51:41 +0000 (21:51 +0200)]
Change the synopsis in POSIX.pod to stress use POSIX ();
Explicitly warn that the default of importing everything means that
use POSIX; has to import 553 symbols. Hence it's probably better to use
an explicit import list, or import nothing.
Nicholas Clark [Thu, 1 Sep 2011 19:32:13 +0000 (21:32 +0200)]
Generate @POSIX::EXPORT_OK from %reimpl, %replacement and an exception list.
This is considerably terser than listing all the entries for @EXPORT_OK
longhand. With this change we can no longer delete from %replacement in
AUTOLOAD(), as import() and load_imports() may be called after AUTOLOAD()
has already been run.
Nicholas Clark [Thu, 1 Sep 2011 18:07:51 +0000 (20:07 +0200)]
Test that @POSIX::EXPORT and @POSIX::EXPORT_OK are not inadvertently changed.
Nicholas Clark [Thu, 1 Sep 2011 17:00:03 +0000 (19:00 +0200)]
Remove isatty from @POSIX::EXPORT_OK, as it's already in @EXPORT.
This effectively reverts commit
d925a710473da185, which added it and
reformatted the source code. isatty was in (the generated) @EXPORT
at that time, hence there was never a need to add it.
Aristotle Pagaltzis [Wed, 31 Aug 2011 20:08:21 +0000 (22:08 +0200)]
Replace use of AutoLoader in POSIX with a custom compilation deferral scheme.
Nicholas Clark [Wed, 31 Aug 2011 13:20:56 +0000 (15:20 +0200)]
In POSIX, improve the diagnostic for the "use $method" instead.
In the error message, name the POSIX function that was called, as well as
the suggested replacement method. This rephrasing was in the patch
supplied by Aristotle Pagaltzis, but I have retained the existing POSIX
use of :: when describing the method, because given two less than great
choices, I'm inclined to favour retaining the status quo and one change
over two changes.
Aristotle Pagaltzis [Wed, 31 Aug 2011 12:59:57 +0000 (14:59 +0200)]
In POSIX, drastically simplify the wrappers for "unimplemented" functions.
Replace all the subroutines that croak() with a data structure and 8 lines in
POSIX::AUTOLOAD().
[By Aristotle Pagaltzis, with some editing by the committer, and most of his
message changes applied as a previous commit to split apart improvements from
pure refactoring]
This commit eliminates the helper functions POSIX::refef() and
POSIX::unimpl(), which were not part of the documented API, not exported,
and not used in any code outside the core (that is visible to Google
codesearch).
Aristotle Pagaltzis [Thu, 1 Sep 2011 08:49:05 +0000 (10:49 +0200)]
In POSIX.pm, modernise package variable style.
Nicholas Clark [Wed, 31 Aug 2011 12:32:47 +0000 (14:32 +0200)]
The more regular POSIX "unimplemented" diagnostics simplify the tests.
Nicholas Clark [Wed, 31 Aug 2011 11:08:49 +0000 (13:08 +0200)]
Improvements to the diagnostics for "unimplemented" POSIX functions.
Suggested by Aristotle Pagaltzis as part of a larger refactoring.
This regularises the text, changing '--use' and ': use' to ', use' to be
consistent, provides a message for POSIX::srand(), and adds ' is' to the
message for POSIX::bsearch().
Most of the diagnostics have been unchanged since perl 5.000. For some,
IO::Handle replaced FileHandle in perl5.003_20 (
28757baaaeaa3801).
div and ldiv's messages were improved to also mention % in 2003 by commit
7a6ca5fd18d88091.
Nicholas Clark [Wed, 31 Aug 2011 18:58:00 +0000 (20:58 +0200)]
Test the POSIX functions that wrap core builtins.
No need to test the 7 tested elsewhere.
Nicholas Clark [Wed, 31 Aug 2011 16:19:34 +0000 (18:19 +0200)]
Convert the POSIX waitpid tests to Test::More.
Explicitly test POSIX::exit(), POSIX::fork(), POSIX::sleep() and
POSIX::waitpid(). Use POSIX::_exit() in the child process.
Nicholas Clark [Wed, 31 Aug 2011 16:02:00 +0000 (18:02 +0200)]
Explicitly test both CORE:: and POSIX:: gmtime and localtime.
The POSIX:: versions should be identical to the CORE:: versions, as they are
just wrappers. But the wrappers need testing.
Nicholas Clark [Wed, 31 Aug 2011 14:41:12 +0000 (16:41 +0200)]
Test the diagnostics for usage messages for POSIX wrapper functions.
Regularise the 3 inconsistent messages.
Nicholas Clark [Wed, 31 Aug 2011 10:13:46 +0000 (12:13 +0200)]
Test the diagnostics for all POSIX::* functions that are "unimplemented".
Nicholas Clark [Wed, 31 Aug 2011 09:32:17 +0000 (11:32 +0200)]
In ext/POSIX/t/is.t, make better use of Test::More.
cmp_ok() will give better diagnostics than ok(). Using skip_all() is terser,
and will give better diagnostics.
Gerard Goossen [Wed, 31 Aug 2011 13:55:26 +0000 (15:55 +0200)]
Use OPpDEREF for lvalue sub, such that the flags contains the deref type, instead of deriving it from the opchain.
Also contains a test where using the opchain to determine the deref
type fails.
Gerard Goossen [Wed, 31 Aug 2011 13:30:00 +0000 (15:30 +0200)]
Reassign op_private flags of OP_ENTERSUB such that bits 32 and 64 can be used by OPpDEREF
Chris 'BinGOs' Williams [Thu, 1 Sep 2011 18:24:52 +0000 (19:24 +0100)]
Update CPANPLUS to CPAN version 0.9110
[DELTA]
Changes for 0.9110 Thu Sep 1 13:43:06 2011
================================================
* CPANPLUS::Dist::MM now ensures that Makefile.PL
is older than any generated Makefile
* When resolving dependencies ignore any @INC-hook
when finding installed modules
* Updated the META.yml in the dist to specify
'dynamic_config' as true.
Gerard Goossen [Sat, 27 Aug 2011 15:08:07 +0000 (17:08 +0200)]
Fix overloaded <> when the peephole optimiser is disabled.
Father Chrysostomos [Thu, 1 Sep 2011 15:13:51 +0000 (08:13 -0700)]
[perl #97492] Tests & delta for defined ${"::!"}
Father Chrysostomos [Thu, 1 Sep 2011 05:44:57 +0000 (22:44 -0700)]
[perl #97484] Make defined &{...} vivify CORE subs
Magical variables usually get autovivified, even in rvalue context,
because Perl is trying to pretend they have been there all along.
That means defined(${"."}) will autovivify $. and return true.
Until CORE subs were introduced, there were no subroutines that popped
into existence when looked at.
This commit makes rv_2cv use the GV_ADDMG flag added in commit
23496c6ea. When this flag is passed, gv_fetchpvn_flags creates a GV
but does not add it to the stash until it finds out that it is creat-
ing a magical one. The CORE sub code calls newATTRSUB, which expects
to add the CV to the stash itself. So the gv has to be added there
and then. So gv_fetchpvn_flags is also adjusted to add the gv to the
stash right before calling newATTRSUB, and to tell itself that the
GV_ADDMG flag is actually off.
It might be better to move the CV-creation code into op.c and inline
parts of newATTRSUB, to avoid fiddling with the addmg variable (and
avoid prototype checks on CORE subs), but that refactoring should
probably come in separate commits.
Father Chrysostomos [Thu, 1 Sep 2011 04:27:58 +0000 (21:27 -0700)]
[perl #98092] Fix unreferenced scalar warnings in clone.t
Commit
da6b625f78 triggered an unrelated bug, by rearranging things in
memory so that the conditions were right:
If @DB::args has been populated, and then the items in it have been
freed, they can end up being reused for any SV-ish things allocated
thereafter, even lexical pads.
Each CV (subroutine) has a list of pads, called the padlist, which is
the same structure as a Perl array (an AV) underneath. The padlist’s
memory management is done in pad.c, as there are other things that
have to be done when its elements (the pads themselves) are freed.
So, to prevent av.c from trying to free those elements, the padlist is
not marked REAL; i.e., it’s marked as not having its elements refer-
ence-counted, even though they are: it’s just not handled in av.c
The ‘Attempt to free unreferenced scalar’ warnings emitted by
threads::shared’s clone.t occurred when padlists and pads ended up
using freed SVs that were still in @DB::args. When a new thread was
created, the pads in @DB::args ended up getting cloned when @DB::args
was cloned; hence they were treated as non-reference-counting arrays,
and the pads inside them were cloned with a lower reference count than
they ought to have had (sv_dup was called, instead of sv_dup_inc).
The pad-duplication code (pad_dup), like the regular SV-duplication
code, checks first to see if a padlist has been cloned already, before
actually doing it. There was also a problem with pad_dup not incre-
menting the reference count of an already-cloned padlist.
So this commit fixes the pad_dup reference-counting bug and also
leaves AvREAL on for padlists, until the very last moment when they
are freed (in pad_free) with SvREFCNT_dec.
Steve Hay [Thu, 1 Sep 2011 12:34:38 +0000 (13:34 +0100)]
Update Win32 canned config header files
There should be no real changes here: just run the regen_config_h target
in the Makefile, and then restore various Win32-specific things (mostly
the support of GCC in a VC++ build and vice versa) which get lost.
Rafael Garcia-Suarez [Wed, 31 Aug 2011 19:59:40 +0000 (21:59 +0200)]
Make switchC.t pass if the environment variable PERL_UNICODE contains "S"
(actually doing so the quick way, by skipping the last test, that tests
for -CS on the shebang line)
Steve Hay [Wed, 31 Aug 2011 17:48:37 +0000 (18:48 +0100)]
Preliminary cleanup of win32/config*.* prior to updating them fully
- Set lseeksize/lseektype to 4/long in new gc64* files (see
f7e8b52a89)
- Add missing NULL parameter in new gc64* files (see
e6a0bbf8b4)
- Change new gc64* files to a minimal setup (see
d64224560b and
17bdc11416)
- Make the order of the __GNUC__ / _MSC_VER logic consistent
- Add __GNUC__ magic to vc64 (since new gc64* files have _MSC_VER magic)
Chris 'BinGOs' Williams [Wed, 31 Aug 2011 13:51:06 +0000 (14:51 +0100)]
Updated Locale-Codes to CPAN version 3.18
[DELTA]
VERSION 3.18 (2011-08-31)
NEW CODE(s)
No longer use CIA data
The CIA world added non-standard values, so I no longer use it as a source of data. Based on a report by Michiel Beijen.
Father Chrysostomos [Tue, 30 Aug 2011 16:42:05 +0000 (09:42 -0700)]
Avoid an extra SV when creating $] and $^V
Originally, GVs always had something in the SV slot. So, when the
code for $] and $^V started replacing it with another SV, it had to
free the existing SV.
Then commit
c69033f2 came along and added the PERL_DONT_CREATE_GVSV
directive. It necessarily changed a bunch of GvSV()s to GvSVn()s in
gv_fetchpvn_flags. But it changed these two, even though they didn’t
need it. So, when PERL_DONT_CREATE_GVSV is true (the default), we
just create and throw away a scalar needlessly.
Father Chrysostomos [Tue, 30 Aug 2011 16:31:47 +0000 (09:31 -0700)]
Eliminate is_gv_magical_sv
This resolves perl bug #97978.
Many built-in variables, like $], are actually created on the fly
when first accessed. Perl likes to pretend that these variables have
always existed, so it autovivifies the *] glob even in rvalue context
(e.g., defined *{"]"}, close "]").
The list of variables that were autovivified was maintained separ-
ately (in is_gv_magical_sv) from the code that actually creates
them (gv_fetchpvn_flags). ‘Maintained’ is not actually precise: it
*wasn’t* being maintained, and there were new variables that never
got added to is_gv_magical_sv and one deleted variable that was
never removed.
There are only two pieces of code that call is_gv_magical_sv, both in
pp.c: S_rv2gv (called by *{} and also the implicit *{} that functions
like close() provide) and Perl_softrefxv (called by ${}, @{}, %{}).
In both cases, the glob is immediately autovivified if
is_gv_magical_sv returns true.
So this commit eliminates the extra maintenance burden by extirpat-
ing is_gv_magical_sv altogether, and replacing it with a new flag to
gv_fetchpvn_flags, GvADDMG, which will autovivify a glob *if* it’s a
magical one.
It does make defined(*{"frobbly"}) slightly slower, in that it creates
a temporary glob and then frees it when it sees nothing magical has
been done with it. But this case is rare enough it should not matter.
At least I got rid of the bugginess.
Nicholas Clark [Tue, 30 Aug 2011 16:06:38 +0000 (18:06 +0200)]
Remove 3 unused scripts from Porting
Porting/findvars was added in 1998 in
2bd2b9e04a68ec86. It searches @ARGV for
its wordlist of then-current interpreter variable names.
Porting/fixvars was added as fixvars in 1998 in
a15299417de39f35. It captures
the output of make (defaulting to make miniperl), parses it for errors
matching /undeclared/, and then attempts to edit the relevant line of the
reported file to prefix the name with PL_
Porting/fixCORE is a modified copy of Porting/fixvars, added in 1998 in
a8693bd382efcc6d. It's intended to load modules, catching errors of the form
/Ambiguous call resolved as CORE::/, and editing the relevant lines to prefix
CORE:: to the function in question. It appears only ever to have been used to
fix warnings in Math::Complex.
All 3 have only had trivial style and spelling edits since addition, and
have been unused for over 12 years.
Nicholas Clark [Thu, 25 Aug 2011 15:08:25 +0000 (17:08 +0200)]
Generate $Config::Config{byteorder} slightly more efficiently.
Father Chrysostomos [Tue, 30 Aug 2011 03:19:31 +0000 (20:19 -0700)]
Tiny typo in perldelta
The fact that I typed a comma for 2 probably bewrays what keyboard
layout I’m using. :-)
Father Chrysostomos [Tue, 30 Aug 2011 03:16:30 +0000 (20:16 -0700)]
Update docs about &CORE::subs()
Father Chrysostomos [Tue, 30 Aug 2011 01:24:36 +0000 (18:24 -0700)]
&CORE::write()
This commit allows &CORE::write to be called through references and
via ampersand syntax. No change to pp_enterwrite was necessary, as it
can already handle nulls.
Father Chrysostomos [Tue, 30 Aug 2011 01:12:56 +0000 (18:12 -0700)]
&CORE::unpack()
This commit allows &CORE::unpack to be called through references and
via ampersand syntax.
It moves the $_-handling code in pp_coreargs inside the parameter
loop, so it can apply to the second parameter, not just the first.
Consequently, a mkdir test has been added that ensures implicit $_
is not used for mkdir’s second argument; i.e., that the $_-handling
code’s if() condition is correct.
Father Chrysostomos [Mon, 29 Aug 2011 21:15:34 +0000 (14:15 -0700)]
&CORE::umask()
This commit allows &CORE::umask to be called through references and
via ampersand syntax. pp_umask is modified to take into account the
nulls pushed on to the stack in pp_coreargs, which happens because
pp_coreargs has no other way to tell umask how many arguments it’s
actually getting. See commit
0163043a for details.
Father Chrysostomos [Mon, 29 Aug 2011 20:43:17 +0000 (13:43 -0700)]
&CORE::foo() for tie functions
This commit allows the tie, tied and untie subroutines in the CORE
namespace to be called through references and via &ersand() syntax.
pp_coreargs is modified to handle the functions with \[$@%*] in their
prototypes (which happen to be just the tie functions).
Father Chrysostomos [Mon, 29 Aug 2011 19:58:17 +0000 (12:58 -0700)]
&CORE::tell()
This commit allows &CORE::tell to be called through references and
via ampersand syntax. pp_tell is modified to take into account the
nulls pushed on to the stack in pp_coreargs, which happens because
pp_coreargs has no other way to tell pp_tell how many arguments it’s
actually getting. See commit
0163043a for details.
Father Chrysostomos [Mon, 29 Aug 2011 16:54:20 +0000 (09:54 -0700)]
&CORE::setpgrp()
This commit allows &CORE::setpgrp to be called through references and
via ampersand syntax. pp_setpgrp is modified to take into account the
nulls pushed on to the stack in pp_coreargs, which happens because
pp_coreargs has no other way to tell setpgrp how many arguments it’s
actually getting. See commit
0163043a for details.
Father Chrysostomos [Mon, 29 Aug 2011 16:34:16 +0000 (09:34 -0700)]
Make setpgrp($x) equivalent to setpgrp($x,0)
Prior to this commit, setpgrp(27) was equivalent to (27, setpgrp),
because it ignored the argument on the stack when there was only one.
Father Chrysostomos [Mon, 29 Aug 2011 16:02:35 +0000 (09:02 -0700)]
make setpgrpstack.t use skip_all_without_config
Stephen Bennett [Mon, 29 Aug 2011 17:44:50 +0000 (19:44 +0200)]
ExtUtils::ParseXS: Don't put null chars into generated source
... file when -except is used; write the '\0' escape sequence
properly instead.
Steffen Mueller [Mon, 29 Aug 2011 17:43:56 +0000 (19:43 +0200)]
Add Stephen Bennett to AUTHORS
Nicholas Clark [Mon, 29 Aug 2011 13:25:23 +0000 (15:25 +0200)]
For s///r, don't call SvPV_force() on the original value. Resolves #97954.
8ca8a454f60a417f optimised the implementation of s///r by avoiding an
unconditional copy of the original value. However, it introduced a behaviour
regression where if original value happened to be one of a few particular
types, it could be modified by being forced to a string using SvPV_force().
The substitution was (correctly) performed on a copy of this string.
Florian Ragwitz [Mon, 29 Aug 2011 10:14:00 +0000 (12:14 +0200)]
Remove some resolved pod issues
Florian Ragwitz [Mon, 29 Aug 2011 09:35:01 +0000 (11:35 +0200)]
perlfaq is now maintained on CPAN
Florian Ragwitz [Mon, 29 Aug 2011 09:10:09 +0000 (11:10 +0200)]
Upgrade perlfaq from version 5.015003 to 5.
01500301
Florian Ragwitz [Sat, 27 Aug 2011 10:32:16 +0000 (12:32 +0200)]
Let's have at least one indexed package in perlfaq
This way we get to make use of PAUSE's permission system instead of allowing
everyone to to upload new perlfaq versions.
Father Chrysostomos [Mon, 29 Aug 2011 01:23:49 +0000 (18:23 -0700)]
&CORE::sysopen()
This commit allows &CORE::sysopen to be called through references and
via ampersand syntax. pp_sysopen is modified to take into account the
nulls pushed on to the stack in pp_coreargs, which happens because
pp_coreargs has no other way to tell sysopen how many arguments it’s
actually getting. See commit
0163043a for details.
Father Chrysostomos [Sun, 28 Aug 2011 13:34:48 +0000 (06:34 -0700)]
Use leavesublv for all CORE subs
and not just lock, vec and substr. Using a regular leavesub op causes
the return values to be copied. There is no need for that, so this
commit changes them all to use leavesublv.
Father Chrysostomos [Mon, 29 Aug 2011 01:08:52 +0000 (18:08 -0700)]
Make tie_fetch_count.t pass with PERL_UNICODE set
Father Chrysostomos [Mon, 29 Aug 2011 00:49:40 +0000 (17:49 -0700)]
Make coreamp.t pass with PERL_UNICODE set
Craig A. Berry [Sun, 28 Aug 2011 20:42:58 +0000 (15:42 -0500)]
Thinko in vms.c:copy_expand_unix_filename_escape().
Turns out comparing a signed byte to values above 0x7f doesn't make
sense. *All* signed byte integers are less than or equal to 0x9f,
so the other two branches of the if could never be taken.
This code probably needs more review and testing, but we might as
well make it do what it intends to do before reviewing those
intentions and factoring out some of the copy-and-paste verbosity.
Steffen Mueller [Sun, 28 Aug 2011 15:51:06 +0000 (17:51 +0200)]
Backport XS_(IN|EX)TERNAL, be explicit about linkage
With XS(name) defaulting to exporting symbols again since the
previous commit, ExtUtils::ParseXS will now instead use explicit
XS_EXTERNAL/XS_INTERNAL in its place. This allows backporting
of the linkage changes to perls as old as 5.10.0 (and possibly
further).
Steffen Mueller [Sun, 28 Aug 2011 15:45:37 +0000 (17:45 +0200)]
Revert back to making XS(name) expose XSUB symbols
Instead, as Zefram recommended, ExtUtils::ParseXS will be patched
to not export XSUB symbols by default that are generated through
the module itself. As Zefram said, this has the advantage of
allowing older perls to benefit from the non-exporting of symbols.
Father Chrysostomos [Sun, 28 Aug 2011 06:29:13 +0000 (23:29 -0700)]
&CORE::substr()
This commit makes &CORE::substr callable through references and via
&ersand syntax.
It’s a bit awkward, as we need a substr op that is flagged as hav-
ing 4 arguments *and* possibly returning an lvalue. The code in
op_lvalue_flags wasn’t really set up for that, so I needed to flag
the op with OPpMAYBE_LVSUB in coresub_op before it gets passed to
op_lvalue_flags. It turned out that only that was necessary, as
op_lvalue_flags does an op_private == 4 check (rather than (op_private
& 7) == 4 or some such) when checking for the 4-arg case and croak-
ing. When the op arrives in op_lvalue_flags, it’s already flagged
OPpMAYBE_LVSUB|4 which != 4.
pp_substr is also modified to check for nulls and, if necessary,
adjust its count of how many arguments were actually passed.)
Father Chrysostomos [Sun, 28 Aug 2011 01:50:19 +0000 (18:50 -0700)]
&CORE::srand()
This commit allows &CORE::srand to be called through references and
via ampersand syntax. pp_srand is modified to take into account the
nulls pushed on to the stack in pp_coreargs, which happens because
pp_coreargs has no other way to tell srand how many arguments it’s
actually getting. See commit
0163043a for details.
Father Chrysostomos [Sun, 28 Aug 2011 01:40:05 +0000 (18:40 -0700)]
&CORE::sleep()
This commit allows &CORE::sleep to be called through references and
via ampersand syntax. pp_sleep is modified to take into account the
nulls pushed on to the stack in pp_coreargs, which happens because
pp_coreargs has no other way to tell sleep how many arguments it’s
actually getting. See commit
0163043a for details.
Unfortunately, sleep with no args is nearly impossible to test porta-
bly. But I have checked that it works.
Craig A. Berry [Sun, 28 Aug 2011 03:20:16 +0000 (22:20 -0500)]
Close some unclosed comments in vms/vms.c.
Clearly this code is not well-tested. Especially the parts that
the compiler couldn't see because it was hidden by unclosed
comment blocks. Ouch.
I'm not going to name names or look too deep in the blame log, but
suffice it to say that this is why patches that add hundreds of
lines of new code without tests should not be accepted.
Craig A. Berry [Sun, 28 Aug 2011 03:12:24 +0000 (22:12 -0500)]
Fix miscellaneous compiler warnings in vms/vms.c.
A couple of empty parameter lists and a couple of unsigned -1
error statuses. Brought to you by
-Duser_c_flags=/WARN=(ENABLE=LEVEL4,INFORMATIONAL=ALL)
which is only the third highest warning level.
Craig A. Berry [Sun, 28 Aug 2011 03:07:43 +0000 (22:07 -0500)]
Remove unnecessary includes from vms/vms.c.
A couple are only needed for the homegrown utime() replacement on
older systems. rmsdef.h is apparently not needed at all.
Father Chrysostomos [Sat, 27 Aug 2011 18:13:48 +0000 (11:13 -0700)]
&CORE::send() and &CORE::syswrite()
This commit makes &CORE::send and &CORE::syswrite callable through references and & syntax.
All this commit has to do is remove them from the exception list in
gv.c, as previous commits happen to have made them work. (I didn’t
realise originally that these use pushmark.)
Father Chrysostomos [Sat, 27 Aug 2011 16:50:22 +0000 (09:50 -0700)]
&CORE::select()
This commit allows CORE::select to be called through references and
via &ersand syntax.
This is a tricky case, as the select keyword represents two distinct
operators. ck_select replaces the OP_SELECT with an OP_SSELECT if
there is more that one argument.
So what we do here is create an if(@_>1)/else block with the usual
op-with-coreargs-child inside each branch.
The op tree looks like this:
$ ./perl -Ilib -mO=Concise,CORE::select -e 'BEGIN{\&CORE::select}
'
CORE::select:
8 <1> leavesub[1 ref] K/REFC,1 ->(end)
- <1> null K/1 ->8
5 <|> cond_expr(other->6) K/1 ->9
4 <2> gt sK/2 ->5
2 <1> rv2av[t4] sK/1 ->3
1 <#> gv[*_] s ->2
3 <$> const[IV 1] s ->4
7 <@> sselect[t2] K ->8
- <0> ex-pushmark s ->6
6 <$> coreargs(IV 218) ->7
a <@> select[t1] sK/1 ->8
- <0> ex-pushmark s ->9
9 <$> coreargs(IV 219) s/DREF1 ->a
-e syntax OK
There was no need to modify pp_select to handle a null when there is
no argument, as it can already handle it.
Father Chrysostomos [Sun, 28 Aug 2011 00:39:40 +0000 (17:39 -0700)]
Document getprotobynumber’s precedence
Father Chrysostomos [Sun, 28 Aug 2011 00:33:46 +0000 (17:33 -0700)]
perlfunc/gethostbyname: Add missing C in C<>
Father Chrysostomos [Sat, 27 Aug 2011 12:46:25 +0000 (05:46 -0700)]
Testing deparsing of CORE::not
Craig A. Berry [Sat, 27 Aug 2011 22:26:25 +0000 (17:26 -0500)]
Get coreamp.t passing on VMS.
The last record in a file ends with a newline willy nilly, so we
might as well write (and test for) one explicitly.
The name of a directory file ends with .DIR, so we need to allow
for that.
File::Temp panics when trying to delete the directory that is the
current working directory, so save where we were and restore to it
before clean-up.