Steve Hay [Sat, 4 Aug 2012 13:01:27 +0000 (14:01 +0100)]
Remove CR characters from raw input in op/magic.t on Windows
The :raw input added by
e2e1d5ce8b broke tests on Windows by introducing
unexpeted CR characters.
Two tests (154 and 157) currently still fail on Windows if the (DOS)
command prompt is using a different code page to perl's native (Windows)
character set.
David Leadbeater [Sun, 29 Jul 2012 12:12:03 +0000 (13:12 +0100)]
Module::CoreList: Automatically add aliases for releases
When the release in numeric and conventional written form differ add an
alias for the formatted variant automatically.
David Leadbeater [Sun, 29 Jul 2012 00:39:05 +0000 (01:39 +0100)]
Store version information as a delta in Module::CoreList
This reduces the size of the CoreList.pm file by storing the difference
between the versions of perl rather than a full list for each version.
In order to achieve this without changing the interface each key in the
%version hash is tied to a special tied hash that inflates the stored
difference data to the full list of modules and versions.
As part of the upgrade I ran a comparison with the
%version hash in the current Module::CoreList -- there are no
differences.
Tony Cook [Sat, 4 Aug 2012 03:53:38 +0000 (13:53 +1000)]
avoid decoding on input in the new tests added in
613c63b4
This fixes these tests when run in a unicode environment, eg:
PERL_UNICODE= LC_ALL=en_AU.utf8 ./perl op/magic.t
This does fix tha code page related issue on Win32.
Father Chrysostomos [Sat, 4 Aug 2012 01:35:26 +0000 (18:35 -0700)]
[perl #114222] Make ‘use’ parse arguments in term context
(lexing context, that is)
use constant { () }
was a syntax error, because the lexer was guessing when { should be
a statement or hash.
It should not be doing that where a term is expected.
It was actually getting itself confused, and trying to parse the
argument list as a statement.
Setting PL_expect after force_next is ineffectual, as force_next
records the current value of PL_expect, arranging to have it
restored.
OPERATOR(USE) was setting PL_expect, but too late. So no we set
PL_expect explicitly in S_tokenize_use, before any forced tokens,
and use TOKEN(USE), which does not set PL_expect (as setting it
there has no effect).
Reini Urban [Sun, 15 Jul 2012 17:15:45 +0000 (12:15 -0500)]
perlexperiment.pod clarifications
Removed in Perl is misleading. Those modules just moved to CPAN and are not deprecated.
threads are now ithreads since multiplicity.
Tony Cook [Fri, 3 Aug 2012 13:33:10 +0000 (23:33 +1000)]
Pod-Functions requires that Pod-Escapes be built to build
Discovered doing a parallel build on OpenBSD, reproducible elsewhere
with:
./Configure ... && make ext/Pod-Functions/pm_to_blib
While Pod-Escapes is a dependency of Pod-Simple, the Pod-Simple build
process doesn't require that Pod-Escapes already be built, while the
Pod-Functions build process does.
Andy Dougherty [Thu, 2 Aug 2012 18:59:55 +0000 (14:59 -0400)]
Fix RT [perl #72156] Re: Perl 5.12.0 RC 0 - Pager detection
Instruct ./getfile to trust the default pager value. It might not begin
with a slash, or it might include some options, such as
"/usr/bin/less -R".
This is based on commit
53ddb3ba3e23ab80444c30b4deefa64114408438 in
the metaconfig repository.
Steffen Mueller [Thu, 2 Aug 2012 18:24:40 +0000 (20:24 +0200)]
Data::Dumper: Comment on previous optimization
The optimization in the previous commit to Data::Dumper (sparse seen
hash) is not complete: It is so far only applied to non-RV SVs. This
also means that it's safe not to check for weak-refs. Applying the
optimization to RVs should be possible, but is not as easy (I think).
Steffen Mueller [Thu, 2 Aug 2012 16:51:19 +0000 (18:51 +0200)]
Data::Dumper: Option to avoid building much of the seen hash
If the "$Sparseseen" option is set by the user, Data::Dumper eschews
building the seen-this-scalar hash for ALL SCALARS but instead just adds
those that have a refcount > 1. Since the seen hash is exposed
to the user in the OO interface (rats!), this needs to be opt-in in if
OO is used.
If the DD constructor is called from Dumpxs (because the user used the
functional interface as customary), then this option could be
implicitly enabled in those cases as the seen hash is never visible to
the user.
In my real-world-data benchmark, setting this option speeds up
serialization by about 50%!
This is really Yves Orton's idea. I'm just the code monkey on this one.
Father Chrysostomos [Thu, 2 Aug 2012 17:01:43 +0000 (10:01 -0700)]
perldelta for unterminated here-docs
Father Chrysostomos [Thu, 2 Aug 2012 16:52:27 +0000 (09:52 -0700)]
[perl #114104] Better error for unterminated heredoc delim
Father Chrysostomos [Thu, 2 Aug 2012 05:36:48 +0000 (22:36 -0700)]
perldelta for #114340
Father Chrysostomos [Thu, 2 Aug 2012 05:31:15 +0000 (22:31 -0700)]
perldelta for Storable and vstrings
Father Chrysostomos [Thu, 2 Aug 2012 05:03:34 +0000 (22:03 -0700)]
perldelta for given aliasing $_
Karl Williamson [Thu, 2 Aug 2012 00:28:59 +0000 (18:28 -0600)]
regcomp.c: Remove unnecessary variable
This variable was used because another was declared 'register'. But
that declaration was removed by commit
e1d1eefb8c88e0dcaf2bb9e6c04d7f6192be966f in 2007, making the temporary
variable redundant.
Karl Williamson [Wed, 1 Aug 2012 23:04:13 +0000 (17:04 -0600)]
regcomp.c: inline trivial static function
Karl Williamson [Wed, 1 Aug 2012 21:12:23 +0000 (15:12 -0600)]
regcomp.c: Fix \N{} multi-char fold buffer boundary bug
An earlier commit in this topic branch fixed the bug (for non-\N{})
cases where a multi-character fold could try to span two EXACTFish
nodes, where they are split because the first one would otherwise
contain too long a string.
This commit extends that fix to include characters entered via \N{...}.
It does this by causing \N handling to be split, so that if the \N
resolves to a single code point, it goes through the normal processing,
so that it no longer bypasses the code that was added in the earlier
commit.
Karl Williamson [Wed, 1 Aug 2012 20:49:39 +0000 (14:49 -0600)]
regcomp.c: Revise API for static function
This is to allow future changes. The function now returns success or
failure, and the created regnode (if any) is set via a parameter
pointer.
I removed the 'register' declaration to get this to work, because
such declarations are considered bad form these days, e.g.,
http://stackoverflow.com/questions/314994/whats-a-good-example-of-register-variable-usage-in-c
Karl Williamson [Mon, 18 Jun 2012 19:09:38 +0000 (13:09 -0600)]
regcomp.c: Fix multi-char fold bug
Input text to be matched under /i is placed in EXACTFish nodes. The
current limit on such text is 255 bytes per node. Even if we raised
that limit, it will always be finite. If the input text is longer than
this, it is split across 2 or more nodes. A problem occurs when that
split occurs within a potential multi-character fold. For example, if
the final character that fits in a node is 'f', and the next character
is 'i', it should be matchable by LATIN SMALL LIGATURE FI, but because
Perl isn't structured to find multi-char folds that cross node
boundaries, we will miss this it.
The solution presented here isn't optimum. What we do is try to prevent
all EXACTFish nodes from ending in a character that could be at the
beginning or middle of a multi-char fold. That prevents the problem.
But in actuality, the problem only occurs if the input text is actually
a multi-char fold, which happens much less frequently. For example,
we try to not end a full node with an 'f', but the problem doesn't
actually occur unless the adjacent following node begins with an 'i' (or
one of the other characters that 'f' participates in). That is, this
patch splits when it doesn't need to.
At the point of execution for this patch, we only know that the final
character that fits in the node is that 'f'. The next character remains
unparsed, and could be in any number of forms, a literal 'i', or a hex,
octal, or named character constant, or it may need to be decoded (from
'use encoding'). So look-ahead is not really viable.
So finding if a real multi-character fold is involved would have to be
done later in the process, when we have full knowledge of the nodes, at
the places where join_exact() is now called, and would require inserting
a new node(s) in the middle of existing ones.
This solution seems reasonable instead.
It does not yet address named character constants (\N{}) which currently
bypass the code added here.
Karl Williamson [Mon, 18 Jun 2012 18:55:42 +0000 (12:55 -0600)]
mktables: Generate tables for chars that aren't in final fold pos
This starts with the existing table that mktables generates that lists
all the characters in Unicode that occur in multi-character folds, and
aren't in the final positions of any such fold.
It generates data structures with this information to make it quickly
available to code that wants to use it. Future commits will use these
tables.
Karl Williamson [Mon, 18 Jun 2012 18:44:55 +0000 (12:44 -0600)]
regen/mk_invlists: Add mode to generate above-Latin1 only
This change adds the ability to specify that an output inversion list is
to contain only those code points that are above Latin-1. Typically,
the Latin-1 ones will be accessed from some other means.
Karl Williamson [Mon, 18 Jun 2012 18:38:41 +0000 (12:38 -0600)]
Unicode::UCD::prop_invlist() Allow to return internal property
This creates an optional undocumented parameter to this function to
allow it to return the inversion list of an internal-only Perl property.
This will be used by other functions in Perl, but should not be
documented, as we don't want to encourage the use of internal-only
properties, which are subject to change or removal without notice.
Karl Williamson [Mon, 18 Jun 2012 18:37:52 +0000 (12:37 -0600)]
mktables: Add comment to gen'd data file
Karl Williamson [Mon, 18 Jun 2012 18:22:41 +0000 (12:22 -0600)]
mktables: grammar in comments
Karl Williamson [Mon, 18 Jun 2012 18:20:42 +0000 (12:20 -0600)]
regen/mk_PL_charclass.pl: Remove obsolete code
Octals are no longer checked via this mechanism.
Karl Williamson [Mon, 18 Jun 2012 17:51:43 +0000 (11:51 -0600)]
regcomp.c: Make invlist_search() usable from re_comp.c
This was a static function which I couldn't get to be callable from the
debugging version of regcomp.c. This makes it public, but known only
in the regcomp.c source file. It changes the name to begin with an
underscore so that if someone cheats by adding preprocessor #defines,
they still have to call it with the name that convention indicates is a
private function.
Karl Williamson [Mon, 18 Jun 2012 17:41:18 +0000 (11:41 -0600)]
perlop:clarify wording
Karl Williamson [Sun, 17 Jun 2012 02:02:07 +0000 (20:02 -0600)]
regcomp.c: Rename static fcn to better reflect its purpose
This function handles \N of any ilk, not just named sequences.
Karl Williamson [Sun, 17 Jun 2012 01:55:15 +0000 (19:55 -0600)]
regcomp.c: Make comment more accurate
Karl Williamson [Sun, 17 Jun 2012 01:52:12 +0000 (19:52 -0600)]
regcomp.c: Can now do /u instead of forcing to utf8
Now that there is a /u modifier, a regex doesn't have to be in UTF-8 in
order to force Unicode semantics. Change this relict from the past.
Karl Williamson [Wed, 6 Jun 2012 21:02:43 +0000 (15:02 -0600)]
regcomp.c: Comments update
This adds some comments and white-space lines, and updates other
comments to account for the fact that trie handling has changed since
they were written.
Karl Williamson [Mon, 28 May 2012 16:49:37 +0000 (10:49 -0600)]
regcomp.c: Remove variable whose value needed just once
Previous commits have removed all but one instance of using this
variable, so just use the expression it equates to.
Karl Williamson [Mon, 28 May 2012 16:42:03 +0000 (10:42 -0600)]
regcomp.c: White-space only
This indents and outdents to compensate for newly formed and orphan
blocks, respectively; and reflows comments to fit in 80 columns
Karl Williamson [Sun, 27 May 2012 07:08:46 +0000 (01:08 -0600)]
regcomp.c: Trade stack space for time
Pass 1 of regular expression compilation merely calculates the size it
will need. (Note that Yves and I both think this is very suboptimal
behavior.) Nothing is written out during this pass, but sizes are
just incremented. The code in regcomp.c all knows this, and skips
writing things in pass 1. However, when folding, code in other files is
called which doesn't have this size-only mode, and always writes its
results out. Currently, regcomp handles this by passing to that code a
temporary buffer allocated for the purpose. In pass1, the result is
simply ignored; in pass2, the results are copied to the correct final
destination.
We can avoid that copy by making the temporary buffer large enough to
hold the whole node, and in pass1, use it instead of the node. The
non-regcomp code writes to the same relative spot in the buffer that it
will use for the real node. In pass2 the real destination is used, and
the fold gets written directly to the correct spot.
Note that this increases the size pushed onto the stack, but code is
ripped out as well.
However, the main reason I'm doing this is not this speed-up; it is
because it is needed by future commits to fix a bug.
Karl Williamson [Sun, 27 May 2012 07:04:39 +0000 (01:04 -0600)]
regcomp.c: Use mnemonic not numeric constant
Future commits will add other uses of this number.
Karl Williamson [Sun, 27 May 2012 04:19:22 +0000 (22:19 -0600)]
regcomp.c: Resolve EBCDIC inconsistency towards simpler
This code has assumed that to_uni_fold() returns its folds in Unicode
(i.e. Latin1) rather than native EBCDIC. Other code in the core
assumes the opposite. One has to change. I'm changing this one, as the
issues should be dealt with at the lowest level possible, which is in
to_uni_fold(). Since we don't currently have an EBCDIC platform to test
on, making sure that it all hangs together will have to be deferred
until such time as we do.
By doing this we make this code simpler and faster. The fold has
already been calculated, we just need to copy it to the final place
(done in pass2).
Karl Williamson [Sun, 27 May 2012 03:39:32 +0000 (21:39 -0600)]
regcomp.c: Use function instead of repeating its code
A new flag to to_uni_fold() causes it to do the same work that this code
does, so just call it.
Karl Williamson [Sat, 26 May 2012 20:19:18 +0000 (14:19 -0600)]
regcomp.c: Remove (almost) duplicate code
A previous commit opened the way to refactor this so that the two
fairly lengthy code blocks that are identical (except for changing the
variable <len>) can have one of them removed.
Karl Williamson [Fri, 25 May 2012 04:14:04 +0000 (22:14 -0600)]
regcomp.c: Refactor so can remove duplicate code
This commit prepares the way for a later commit to remove a chunk of
essentially duplicate code. It does this at the cost of an extra
test of a boolean each time through the loop. But, it saves calculating
the fold unless necessary, a potentially expensive operation. When the
next input is a quantifier that calculated fold is discarded, unused.
This commit avoids doing that calculation when the next input is a
quantifier.
K.Shirakata [Fri, 6 May 2011 13:12:57 +0000 (22:12 +0900)]
Fix a perl5140delta typo in F<> markup.
(Patch predates the 5.14.0 release, but was missed at the time.)
Father Chrysostomos [Thu, 2 Aug 2012 03:45:29 +0000 (20:45 -0700)]
[perl #114020] perlvar: warn against my $_
Father Chrysostomos [Thu, 2 Aug 2012 03:36:10 +0000 (20:36 -0700)]
Update perlsyn for given aliasing $_
plus one typo fix
Father Chrysostomos [Thu, 2 Aug 2012 03:12:47 +0000 (20:12 -0700)]
perlfunc/printf: corrections, clarifications
Father Chrysostomos [Thu, 2 Aug 2012 01:08:35 +0000 (18:08 -0700)]
perlfunc: clarification
Father Chrysostomos [Thu, 2 Aug 2012 01:07:05 +0000 (18:07 -0700)]
perlvar: Document all uses of implicit $_
Father Chrysostomos [Wed, 1 Aug 2012 21:17:20 +0000 (14:17 -0700)]
perlfunc: Document implicit $_ in while(each)
Father Chrysostomos [Wed, 1 Aug 2012 21:16:21 +0000 (14:16 -0700)]
[perl #114020, #90018, #53186] Make given alias $_
This commit makes given() alias $_ to the argument, using a slot in
the lexical pad if a lexical $_ is in scope, or $'_ otherwise.
This makes it work very similarly to foreach, and eliminates the
problem of List::Util functions not working inside given().
Father Chrysostomos [Wed, 1 Aug 2012 20:04:14 +0000 (13:04 -0700)]
[perl #114368] perl -DA -e '' segfaults
Iterative freeing of hashes uses the SvMAGIC field for a different
purpose. So clear it before calling hv_undef_flags, which calls
hv_assert, which expects any non-null value fo SvMAGIC to me magic.
Tony Cook [Thu, 2 Aug 2012 00:28:02 +0000 (10:28 +1000)]
fix icmp ping tests on cygwin
Tony Cook [Fri, 27 Jul 2012 13:47:05 +0000 (23:47 +1000)]
Net-Ping: creating an icmp socket requires admin access on recent cygwin
on recent Windows.
cygwin on XP can create an icmp socket as a normal user but can't do
anything with it. On Vista or Win7 the process must be running as
an admin to create the socket.
If someone sees value in running the test on cygwin on XP, they can
provide a patch.
Tony Cook [Fri, 27 Jul 2012 13:39:39 +0000 (23:39 +1000)]
Net-Ping: add a sensible test note for the icmp ping test
Tony Cook [Fri, 27 Jul 2012 13:38:59 +0000 (23:38 +1000)]
fix the cygwin breakage introduced in
2f794ae1
All modern Win32 systems* require admin access to use ICMP sockets from
cygwin, the refactor in
2f794ae1 changed the condition for the skip,
producing a failure here when the test is run unprivileged under
cygwin.
* assuming XP can be called modern
Nicholas Clark [Thu, 28 Jun 2012 16:21:01 +0000 (18:21 +0200)]
Test that when directories in @INC are skipped, coderefs are still called.
For filenames that are absolute, or start with ./ or ../ only coderefs in
@INC are called - directories are skipped. Test this behaviour.
Nicholas Clark [Wed, 27 Jun 2012 16:25:50 +0000 (18:25 +0200)]
Avoid reading before the buffer start when generating errors from require.
In pp_require, the error reporting code treats file names ending /\.p?h\z/
specially. The detection code for this, as refactored in 2010 by commit
686c4ca09cf9d6ae, could read one or two bytes before the start of the
filename for filenames less than 3 bytes long. (Note this cannot happen with
module names given to use or require, as appending ".pm" will always make the
filename at least 3 bytes long.)
Steve Hay [Wed, 1 Aug 2012 17:16:53 +0000 (18:16 +0100)]
Add a USE_64_BIT_INT build option to the Windows makefiles.
Rather than adding more canned configurations, we dynamically set values
which differ from the standard 32-bit build options, and actually remove
the canned configurations for 64-bit builds too and do likewise for them.
The ~ARCHPREFIX~ games used by the outgoing .gc64 configuration needed
bringing into the remaining .gc configuration to maintain support for the
GCCCROSS build option.
Two tweaks to sv.c were required for the USE_64_BIT_INT option to work
with a VC++ build, allowing the I64 printf size specification. The GCC
build worked anyway since it uses ll rather than I64.
The motivation for this change came from a patch submitted by Sisyphus
<sisyphus1@optusnet.com.au>:
Message-ID: <
6AC52DD00C96415A9E919A02F12DD05F@desktop2>
Nicholas Clark [Mon, 30 Jul 2012 15:31:12 +0000 (17:31 +0200)]
Makefile.SH needs to delete the perldelta symlink before creating it.
This seemingly redundant action seems to be necessary for maximum
portability on repeat makes - certainly HP-UX make will happily assume that
the target (the symlink) is out of date, attempt to re-run the rule, and
then fail because the `ln -s` command fails due to the target already
existing.
David Mitchell [Wed, 1 Aug 2012 12:31:03 +0000 (13:31 +0100)]
stop /$unchanging/ leaking
9f141731d83a1ac6294a5580a5b11ff41490309a, part of the re_eval jumbo fix,
introduced a leak. It incremented the ref count of a run-time regex each
time it was re-used, i.e. where the pattern hadn't changed.
Fuji, Goro [Tue, 31 Jul 2012 12:56:11 +0000 (21:56 +0900)]
fix a memory leak in sv_sethek(), amending
70b71ec84
the following code reproduced this issue on perl 5.16.0:
my $o = bless {};
while (1) {
for my $r([], $o) {
ref $r;
}
}
Craig A. Berry [Sun, 15 Jul 2012 21:18:42 +0000 (16:18 -0500)]
x2p/str.c C++ clean-up.
Compiling str.c with HP C++ for OpenVMS says,
FILE_ptr(fp) = (void*)ptr; /* LHS STDCHAR* cast non-portable */
.....................^
%CXX-E-INCASSOPN, a value of type "void *" cannot be assigned to an
entity of type "char *"
at line number 213 in file D0:[craig.blead.x2p]str.c;1
FILE_ptr(fp) = (void*)ptr; /* LHS STDCHAR* cast non-portable */
.................^
%CXX-E-INCASSOPN, a value of type "void *" cannot be assigned to an
entity of type "char *"
at line number 233 in file D0:[craig.blead.x2p]str.c;1
So remove the void casts to avoid the errors. This is an exact
mirror of
d06fc7d4ca98, which also removed the void cast from an
equivalent line in perlio.c. That was almost six years ago, so if
anything especially dire were going to happen without the cast, it
likely would have happened by now.
The casts were added by
cc00df79d5 and
5faea5d5, the former of which
refers vaguely to "compiler worries" without specifying what they
were, but signedness warnings are a likely suspect. We'll get those
again now, but warnings are less bad than errors. A more robust
solution would be to add a Configure-time detection of the type of
FILE._ptr and cast everything to that.
An even more robust solution would be to eliminate all the "buffer
snooping" mechanisms and concede that maintaining an stdio
implementation is a job for stdio maintainers and not Perl
maintainers.
David Mitchell [Tue, 31 Jul 2012 13:30:47 +0000 (14:30 +0100)]
make re_compile core-engine specific
Originally, Perl_re_compile() was the entry point for perl's regex
compiler. After commit
3c13cae629d936c43bca9d992cc445d93287af8e, this
function inadvertently became a wrapper meaning "execute the comp method
of the current engine". Change it back so that it always invokes only
perl's engine.
This fixes [perl #114302] Bleadperl v5.17.0-408-g3c13cae breaks
DGL/re-engine-RE2-0.10.tar.gz
Nicholas Clark [Wed, 11 Jul 2012 18:24:14 +0000 (20:24 +0200)]
In Perl_scalarvoid(), avoid creating a temporary SV for simple messages.
If using an SV to generate a potentially UTF-8 error message, pass that SV
onward to the code that generates warnings, and use a SV-specific format.
Otherwise use a %s format and pass the char * pointer directly to
Perl_ck_warner(). This avoids creating a temporary SV just to hold a fixed
ASCII string, but retains the ability to generate clean UTF-8 error messages.
Father Chrysostomos [Tue, 31 Jul 2012 06:32:11 +0000 (23:32 -0700)]
Storable: blessed long vstrings
I made a mistake in the long vstring code. The stored blessing was
being ignored.
Father Chrysostomos [Tue, 31 Jul 2012 05:57:21 +0000 (22:57 -0700)]
[perl #114338] Misleading prototype in perlapi manpage
Father Chrysostomos [Tue, 31 Jul 2012 03:25:20 +0000 (20:25 -0700)]
[perl #113894] Storable support for vstrings
Father Chrysostomos [Tue, 31 Jul 2012 05:43:06 +0000 (22:43 -0700)]
Get Storable’s blessed.t passing again in 5.8.1-
Back then, sub {} meant sub {wantarray?@_:undef}.
Father Chrysostomos [Mon, 30 Jul 2012 23:17:59 +0000 (16:17 -0700)]
Storable.xs: Add comments to store_scalar concerning utf8
Father Chrysostomos [Mon, 30 Jul 2012 22:59:35 +0000 (15:59 -0700)]
Storable: doc typos
Father Chrysostomos [Mon, 30 Jul 2012 22:53:26 +0000 (15:53 -0700)]
Increase $Storable::VERSION to 2.38
Father Chrysostomos [Mon, 30 Jul 2012 21:27:12 +0000 (14:27 -0700)]
scope.c: Don’t stringify globs on scope exit
This is a waste:
/* Can clear pad variable in place? */
if (SvREFCNT(sv) <= 1 && !SvOBJECT(sv)) {
/*
* if a my variable that was made readonly is going out of
* scope, we want to remove the readonlyness so that it can
* go out of scope quietly
*/
if (SvPADMY(sv) && !SvFAKE(sv))
SvREADONLY_off(sv);
if (SvTHINKFIRST(sv))
sv_force_normal_flags(sv, SV_IMMEDIATE_UNREF);
We can simply drop the globness in sv_force_normal instead of flatten-
ing globs to strings. The same applies to COWs. The SV_COW_DROP_PV
flag accomplishes both.
Before and after:
$ time ./miniperl -e 'for (1..1000000) { my $x = *foo }'
real 0m2.324s
user 0m2.316s
sys 0m0.006s
$ time ./miniperl -e 'for (1..1000000) { my $x = *foo }'
real 0m0.848s
user 0m0.840s
sys 0m0.005s
Craig A. Berry [Tue, 31 Jul 2012 00:29:39 +0000 (19:29 -0500)]
Most magic.t tests can actually run on VMS.
Only the one that clears %ENV is a problem.
Craig A. Berry [Tue, 31 Jul 2012 00:26:40 +0000 (19:26 -0500)]
Correct skip count in magic.t after
613c63b465.
Jan Dubois [Tue, 31 Jul 2012 01:42:42 +0000 (18:42 -0700)]
Remove -x permission from win32/win32.h
No idea why one of my previous commits added the bit. I blame
Cygwin git and the fact that t/porting/exec-bit.t is skipped
on Windows.
Daniel Dragan [Fri, 20 Jul 2012 16:37:53 +0000 (12:37 -0400)]
Add PERL_NO_GET_CONTEXT to Win32CORE
Win32CORE is already ithreads aware, but was still making
Perl_get_context calls. This fixes that. Smaller machine code is the result.
Daniel Dragan [Thu, 19 Jul 2012 18:30:21 +0000 (14:30 -0400)]
Add MSVC noreturn to inside of the interp
12a2785c7e86f586a05cad9ff90ce673c68c3115 only turned on MSVC noreturn for
external DLL XS modules, not inside the interp (perl5**.dll). This commit
fixes that. For me (bulk88), with an -O1 build, perl517.dll dropped
from 1044KB to 1036KB after applying this.
Jan Dubois [Mon, 30 Jul 2012 23:08:01 +0000 (16:08 -0700)]
Split __declspec(dllimport,noreturn) into 2 parts
I thought I did test commit
12a2785c with VC6 and it built without
errors, but I can no longer reproduce this. Checking standard
CRT headers shows common usage (e.g. for longjmp() in setjmp.h) is
"__declspec(dllimport) __declspec(noreturn)", so let's use that
one instead.
Nicholas Clark [Mon, 30 Jul 2012 14:53:52 +0000 (16:53 +0200)]
Fix C pre-processor expression in Dumper.xs
Commit
153920a10f425609 added a second condition to an #ifdef in Dumper.xs,
but didn't change the #ifdef to #if defined. Clearly gcc can cope with the
resulting non-conformant pre-processor expression, but pickier compilers
(such as HP's) reject it. Re-write it in a way that everything accepts.
Father Chrysostomos [Sun, 29 Jul 2012 20:30:35 +0000 (13:30 -0700)]
perlvar: Correct $^S’s description
Father Chrysostomos [Sun, 29 Jul 2012 20:28:21 +0000 (13:28 -0700)]
diagnostics.t: Test BEGIN{die}
Father Chrysostomos [Sun, 29 Jul 2012 20:27:30 +0000 (13:27 -0700)]
Revert "Increase $diagnostics::VERSION to 1.31"
This reverts commit
c369a25dcc5e5c5b627a50d1c4b73c2be0b926b9.
I have just reverted the only other change to diagnostics.pm
since 5.17.2.
Father Chrysostomos [Sun, 29 Jul 2012 20:25:50 +0000 (13:25 -0700)]
Revert "Use $^S instead of caller in splain"
This reverts commit
019070c31184a4deb57cb85f7e597a789c6c5b54.
I misunderstood $^S, and thought I could simplify the code. Contrary
to what perlvar says, $^S is undefined not only during compilation of
an eval or module, but also during compilation of the main program.
Father Chrysostomos [Sun, 29 Jul 2012 20:15:25 +0000 (13:15 -0700)]
perldelta for undef(&foo) and call checkers
Father Chrysostomos [Sun, 29 Jul 2012 20:14:40 +0000 (13:14 -0700)]
Make undef &foo remove call checkers
The fact that the call checker is stored in magic is an implementation
detail. cv_undef does not free magic, so the call checker lives on.
If we were to move the parameter prototype into magic internally, we
would not want undef to stop clearing it. To me, the current situa-
tion with call checkers is similar.
Father Chrysostomos [Sun, 29 Jul 2012 20:01:27 +0000 (13:01 -0700)]
pad.c: document cv_forget_slab
Father Chrysostomos [Sun, 29 Jul 2012 05:48:27 +0000 (22:48 -0700)]
[perl #113940] Make make_ext delete Makefiles when version changes
This eliminates this annoyance:
$ ./perl -Ilib -MStorable -e0
Storable object version 2.37 does not match bootstrap parameter 2.38 at lib/XSLoader.pm line 95.
Compilation failed in require.
BEGIN failed--compilation aborted.
Father Chrysostomos [Sun, 29 Jul 2012 07:26:55 +0000 (00:26 -0700)]
Remove some redundant magical flag checks
Now that gmagical svs use the OK flags the same way as muggles,
things like SvPOK || (SvGMAGICAL && SvPOKp) are no longer necessary.
Father Chrysostomos [Sun, 29 Jul 2012 07:03:45 +0000 (00:03 -0700)]
Use $^S instead of caller in splain
Father Chrysostomos [Sun, 29 Jul 2012 06:58:44 +0000 (23:58 -0700)]
Increase $diagnostics::VERSION to 1.31
Father Chrysostomos [Sun, 29 Jul 2012 06:54:16 +0000 (23:54 -0700)]
perldelta: proto mismatch warnings
Father Chrysostomos [Sun, 29 Jul 2012 06:41:00 +0000 (23:41 -0700)]
Fix scrambled and incorrect proto mismatch error
$ ./perl -Ilib -e 'use constant foo=>bar; sub foo(@);'
Prototype mismatch:: none vs (@) at -e line 1.
$ ./perl -Ilib -e 'sub foo(); sub foo(@);'
Prototype mismatch: () vs (@) at -e line 1.
Notice the double colon and the ‘none’ in the first example?
We also have this bug, where the prototype is the same, but we get the
warning anyway:
$ ./perl -Ilib -e 'use constant foo=>bar; sub foo();'
Prototype mismatch:: none vs () at -e line 1.
When the $::{foo} = \1 constant optimisation was added in 5.10.0, pro-
totype warnings were not taken into account. A forward declaration
like sub foo() puts a string in the stash element. newATTRSUB was
passing a non-SVt_NULL non-gv stash element to cv_ckproto_len_flags,
which assumed that !SvPOK meant no prototype. That’s not the case
with a reference.
The double colon, which goes back to 5.8.4 (
ebe643b99/
59e7bac08e),
occurs when the sub name is not available:
$ perl5.8.4 -e 'sub foo; sub foo();'
Prototype mismatch:: none vs () at -e line 1.
(Before that the message was worse:
$ perl5.8.3 -e 'sub foo; sub foo();'
Prototype mismatch: vs () at -e line 1.)
In 5.10.0, it started applying to constants as well, which used to
show the sub name:
$ perl5.8.9 -e 'use constant foo=>bar; sub foo(@);'
Prototype mismatch: sub main::foo () vs (@) at -e line 1.
$ perl5.10.0 -e 'use constant foo=>bar; sub foo(@);'
Runaway prototype at -e line 1.
Prototype mismatch:: none vs (@) at -e line 1.
(‘Runaway prototype’ is already gone in blead [
acfcf464b177, in which
I stated wrongly that the warning could only come about with stash
manipulation].)
This commit changes cv_ckproto_len_flags to assume that a reference
is a constant with an empty string for a prototype. It also makes
newATTRSUB pass the sub name sv instead of a gv in those cases where
the stash element isn’t a gv. This doesn’t restore things to exactly
the way they were before (foo instead of main::foo), but I’m not sure
it’s worth the added complexity of constructing the fully-qualified
name, just for a warning.
Father Chrysostomos [Sun, 29 Jul 2012 05:52:57 +0000 (22:52 -0700)]
perldelta for
4499db7385 (vstr =~ s/a/a/)
Father Chrysostomos [Sun, 29 Jul 2012 01:32:02 +0000 (18:32 -0700)]
sv.h: Document SvTHINKFIRST
Father Chrysostomos [Sat, 28 Jul 2012 07:39:41 +0000 (00:39 -0700)]
Dumper.xs: Avoid scan_vstring on 5.17.3
Now that vstring set-magic is gone (
4499db7385), there is no
PL_vtbl_vstring, so we cannot use it for detecting vstring
bugginess.
Father Chrysostomos [Sat, 28 Jul 2012 07:35:18 +0000 (00:35 -0700)]
Increase $Data::Dumper::VERSION to 2.135_07
Father Chrysostomos [Sat, 28 Jul 2012 07:33:33 +0000 (00:33 -0700)]
Oust sv_gmagical_2iv_please
The magic flags patch prevents this from ever being called, since the
OK flags work the same way for magic variables now as they have for
muggle vars, avoid these fiddly games. (It was when writing it that I
realised the value of the magic flags proposal.)
Nicholas Clark [Fri, 27 Jul 2012 17:17:54 +0000 (19:17 +0200)]
Remove code for supporting 80286 based systems.
The 80286 was released two years before Perl 1, but the support code was
added with Perl 3. The chip hasn't been produced for more than 15 years -
even the 80386 hasn't been manufactured since 2007. Most of the other
memory model code was removed by commit
5869b1f143426909 in Sep 2000, so
support for 16 bit systems is long dead.
Nicholas Clark [Fri, 27 Jul 2012 15:53:22 +0000 (17:53 +0200)]
Remove dead code related to the Atari ST port of perl 4.0 patchlevel 19
The subdirectory containing the port specific files was purged when 5.000
was released, but changes made to other files were not removed.
Nicholas Clark [Sat, 28 Jul 2012 08:11:08 +0000 (10:11 +0200)]
Merge the refactoring of the filetest OPs' return code.
Nicholas Clark [Fri, 27 Jul 2012 14:38:01 +0000 (16:38 +0200)]
Comment the code with how filetest operators interact with the Perl stack.
Nicholas Clark [Fri, 27 Jul 2012 13:05:00 +0000 (15:05 +0200)]
Eliminate the macros FT_RETURN_FALSE() and FT_RETURN_TRUE().
As they now simply return the results of S_ft_return_false() and
S_ft_return_true() respectively, use this explicitly in the 7 places where
the macros had been used.