| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
Both terms 'capture group' and 'capture buffer' are used in the
documentation. This patch changes most uses of the latter to the
former, as they are referenced using "\g".
|
|
|
|
|
| |
ExtUtils::MakeMaker removed MacOS support in 6.25, merged to blead in December
2004, so this code is vestigial, and a small maintenance penalty.
|
|
|
|
|
| |
ExtUtils::MakeMaker removed MacOS support in 6.25, merged to blead in December
2004, so this code is vestigial, and a small runtime penalty.
|
|
|
|
|
|
|
| |
Use our directly at the first assignment, rather than on a line by itself.
Add editor readonly blocks, consistent with most other generated files.
require Exporter, rather than using it with an empty import list. We don't need
it at compile time.
|
| |
|
|
|
|
| |
as having spelling fixes
|
| |
|
| |
|
| |
|
|
|
|
| |
(plus bump version to 1.89)
|
|
|
|
|
| |
The removal of CVf_ASSERTION in 584420f022db5722 and CVf_LOCKED in
e95ab0c0d2aa1b35 left two gaps in the sequence of bits in use.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The previous commit made various ops such as rv2av unconditionally do
an SvGETMAGIC(). Under some circumstances this could cause a double
mg_get() (and hence double FETCH etc). In particular, when the
proceeding op was something like aelem with OPpDEREF, the aelem would
call vivify_ref(), which would call magic. So in peep(), mark
OP_RV2[SAH]V ops with the new OPpDEREFed flag if the preceding op was
OPpDEREF. Then use this flag to avoid a second dose of magic.
Note that RV2GV probably needs this flag too, but there weren't any
spare private flag bits left for that op (I think).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This changes s/// so that it doesn't act destructively on its target.
Instead it returns the result of the substitution (or the original string if
there was no match).
In addition this patch:
* Adds a new warning when s///r happens in void context.
* Adds a error when you try to use s///r with !~
* Makes it so constant strings can be bound to s///r with =~
* Adds documentation.
* Adds some tests.
* Updates various debug code so it knows about the /r flag.
* Adds some new 'r' words to B::Deparse.
|
| |
|
| |
|
|
|
|
|
|
|
| |
Currently we only compile the top level code with "extreme warnings", so code
in ext/ isn't subject to -Wdeclaration-after-statement, hence why this was
missed. Now that dual life modules have been evicted from ext/, we could
probably consider notching up the warnings for all code in ext/.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
The code in PerlIO-scalar that implements the open $fh, '>' \$buffer
feature did not, apart from accidentally, support get/set magic and thus
tied buffers. This patch remedies that: mostly by just blindly sprinkling
SvGETMAGIC/SvSETMAGIC about, rather than doing any deep analysis and
understanding of the code. One main change I did was to add a
PerlIOScalar_read() function, rather than rely on the default behaviour
(which implements it in terms of PerlIOScalar_get_ptr() etc), since that
approach had a tendency to call FETCH multiple times
|
|\
| |
| |
| |
| | |
Conflicts:
pp_ctl.c
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Makes the G_KEEPERR logic more consistent, and in particular make it
sensibly handle non-string exceptions. An exception in a destructor
is now always emitted as a warning, and never copied or merged into
$@ of the surrounding context. No more clobbering exceptions being
handled elsewhere, and no more double reporting. This fixes the rest of
[perl #74538].
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This is an indirect fix for
[perl #74484] Regex causing exponential runtime+mem usage
The trie runtime code was doing more SAVETMPS than FREETMPS and was thus
growing a large tmps stack on heavy backtracking. Rather than fixing this
directly, I rewrote part of the trie code so that it no longer needs to
allocate memory in S_regmatch (it still does in find_byclass()).
The basic issue is that multiple branches in the trie may trigger an
accept state; for example:
"abcd" =~ /xyz/abcd.*X|ab.*Y|/
here, words (branches) 2 and 3 are accept states. The original approach
was, at run time, to create a list of accepted word numbers and the
character positions of the end of each of those words. Then run the rest
of the pattern for each word in the list in turn (in word index order).
This requires memory for the list to be allocated and freed.
The new approach involves creating extra info at compile time; in
particular, for each word, a pointer to the previous accepted word (if
any) in the state tree. For example for the above pattern, part of the
state tree may be
q b c d
1 -> 2 -> 3 -> 4 -> 5
(#3) (#2)
(e.g. at state 1, if the next char is 'a', we transition to state 2).
Here, state 3 is an accept state with word #3, and 5 is an accept state
with word #2. So we build a table indexed by word number, which has
wordinfo[2] = 3, wordinfo[3] = 0, thus building the word chain 2->3->0.
At run time we run the trie to completion, and remember the word
associated with the longest accept state (word #2 above). Then by following
back the chain of .prev fields, we can produce a list of all accepting
words. We then iteratively find the smallest-numbered (ie LH-most) word in
the chain, and run with it. On failure and backtrack, we find the
next-smallest and so on.
Since we are no longer recording the end-position of each word in the
string, we have to recalculate this for each backtrack. We initially
record the end-position of the shortest accepting word, and given that we
know the length of each word, we can calculate the new position each time
as an offset from that first word. Depending on unicode and folding, that
calculation can be cheap or expensive.
This algorithm is optimised for the typical case where there are a small
number (<= 2) accepting states.
This patch creates a new compile-time array, trie->wordinfo[], indexed by
word number, which contains relevant info about each word. This also
supersedes the old trie->newword[] array, whose function of recording
"overspills" of multiple words per accept state, is now handled as part of
the wordinfo[].prev chain.
|
| |
| |
| |
| |
| | |
Use Proxy Constant Subroutines rather than full-fat subroutines, and simplify
the implementation of the tied hash methods.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
|/
|
|
|
| |
This actually saves space, because xsubpp has to use each XS function's full
name as a constant string to pass to newXS(), so any re-use of it is free.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Based on a patch by AUGUSTE-ETIENNE José <jose.auguste-etienne@cgss-guyane.fr>
The attached patches are necessary to work around aix 4.2 lack of support for IPv6,
and limited support for POSIX sigaction()
The hints/aix_4.sh patch solves the following build failure:
"Socket.xs", line 468.16: 1506-007 (S) "struct in6_addr" is undefined.
The ext/POSIX/t/sigaction.t patch solves the failing test reported a looong time ago:
http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2006-01/msg01124.html
After testing a simple C program using POSIX sigaction() with SA_SIGINFO,
I found that it worked on aix 4.3 but failed on aix 4.2.
I think it's safe to skip the SA_SIGINFO test on the aix 4.2 platform.
perl 5.12.0 builds fine on the following platforms / C compiler :
aix 4.2.1 / vac 5.0.2.7 (with attached patches)
aix 4.3.2 / gcc 2.95.3
aix 4.3.3 / vac 4.4.0.3
aix 4.3.3 / vac 5.0.28
aix 5.2 / GNUpro gcc 2.9.aix51.020209
The atatched patches should be applied to blead and maint.
|
| |
|
|
|
|
| |
Errors in open3 no longer appear to originate from the executed command on forking systems.
|
| |
|
|
|
|
|
|
|
| |
There's a small bug in lex_stuff_pvn() that causes spurious syntax errors
in an obscure situation. It happens if stuffing is performed on the
last line of a file, and the line ends with a statement that lacks its
terminating semicolon. Attached patch fixes and adds test.
|
|\ |
|
| |
| |
| |
| |
| |
| |
| | |
Add an sv_count() function to XS::APItest to allow access to PL_sv_count,
then add new test file t/op/svleak.t that allows you yo run a code
fragment a few times and test whether the number of allocated SVs has
increased
|
| |
| |
| |
| |
| | |
than EXPORT as they're new functions which clobber symbols in downstream
CPAN modules.
|
|/
|
|
| |
https://bugs.launchpad.net/ecryptfs/+bug/390833)
|
|
|
|
| |
Spotted by Olivier Raginel.
|
|
|
|
|
|
|
|
| |
Since the module reorganisation and now that tests run cd'ed to
ext/Fcntl, expecting to run ../perl no longer works.
Also, for the benefit of future generations, make the inability
to find perl a failure rather than a skip, with a more relevant error
message.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Socket6 implementation of inet_pton.
Fix for release-blocking ticket [perl #72884]
> |https://rt.cpan.org/Ticket/Display.html?id=52497|4411113f|NJH/IO-Socket-Multicast6-0.03.tar.gz |
I'll describe what's happening here, and leave it to everyone else to decide
which of the interacting events is the bug, or where the fix might be.
So the *entire* change is this:
commit 4411113f31b3f00171bb335092b02104d29d7cd7
Author: Rafael Garcia-Suarez <rgarciasuarez@gmail.com>
Date: Fri Mar 27 13:19:16 2009 +0100
Add inet_pton and inet_ntop to the list of functions exported by Socket
diff --git a/ext/Socket/Socket.pm b/ext/Socket/Socket.pm
index 6b268ef..7d130ba 100644
--- a/ext/Socket/Socket.pm
+++ b/ext/Socket/Socket.pm
@@ -198,6 +198,7 @@ use XSLoader ();
@ISA = qw(Exporter);
@EXPORT = qw(
inet_aton inet_ntoa
+ inet_pton inet_ntop
sockaddr_family
pack_sockaddr_in unpack_sockaddr_in
pack_sockaddr_un unpack_sockaddr_un
and test fails like this:
$ /home/nick/Sandpit/snap5.9.x-v5.11.4-85-g95c9bfa/bin/perl5.11.4 -Mblib t/35mcastsend.t
1..11
Constant subroutine IO::Socket::Multicast6::AF_INET6 redefined at /home/nick/Sandpit/snap5.9.x-v5.11.4-85-g95c9bfa/lib/perl5/5.11.4/Exporter.pm line 64.
at /home/nick/.cpan/build/IO-Socket-Multicast6-0.03-CqGAYT/blib/lib/IO/Socket/Multicast6.pm line 10
Prototype mismatch: sub IO::Socket::Multicast6::AF_INET6 () vs none at /home/nick/Sandpit/snap5.9.x-v5.11.4-85-g95c9bfa/lib/perl5/5.11.4/Exporter.pm line 64.
at /home/nick/.cpan/build/IO-Socket-Multicast6-0.03-CqGAYT/blib/lib/IO/Socket/Multicast6.pm line 10
Constant subroutine IO::Socket::Multicast6::PF_INET6 redefined at /home/nick/Sandpit/snap5.9.x-v5.11.4-85-g95c9bfa/lib/perl5/5.11.4/Exporter.pm line 64.
at /home/nick/.cpan/build/IO-Socket-Multicast6-0.03-CqGAYT/blib/lib/IO/Socket/Multicast6.pm line 10
Prototype mismatch: sub IO::Socket::Multicast6::PF_INET6 () vs none at /home/nick/Sandpit/snap5.9.x-v5.11.4-85-g95c9bfa/lib/perl5/5.11.4/Exporter.pm line 64.
at /home/nick/.cpan/build/IO-Socket-Multicast6-0.03-CqGAYT/blib/lib/IO/Socket/Multicast6.pm line 10
ok 1 - use IO::Socket::Multicast6;
ok 2 - Create IPv4 multicast socket
ok 3 - Combined IPv4 destination address and port
ok 4 - Separate IPv4 destination address and port
Bad arg length for Socket::pack_sockaddr_in, length is 16, should be 4 at t/35mcastsend.t line 26.
The warnings aren't actually really relevant. The "problem"s are:
IO::Socket::Multicast6 isa IO::Socket::INET6
IO::Socket::INET6 isa IO::Socket
so they chose to inherit all behaviour from IO::Socket. In turn
IO::Socket isa IO::Handle isa Exporter.
IO::Socket chooses to export everything that Socket does:
sub import {
my $pkg = shift;
if (@_ && $_[0] eq 'sockatmark') { # not very extensible but for now, fast
Exporter::export_to_level('IO::Socket', 1, $pkg, 'sockatmark');
} else {
my $callpkg = caller;
Exporter::export 'Socket', $callpkg, @_;
}
}
So, this means that all those choices and delegation of behaviour (and
responsibility) means that all those modules export whatever Socket exports.
OO modules.
So, now they also export inet_pton and inet_ntop.
The test is careful to only import what it needs:
use strict;
use Socket6 qw/ inet_pton pack_sockaddr_in6/;
use Socket qw/ pack_sockaddr_in /;
use Test::More tests => 11;
in particular, it wants inet_pton from Socket6, and only pack_sockaddr_in
from Socket. So at that point, main::inet_pton is Socket6::inet_pton
Then it does this, correctly in a BEGIN block:
BEGIN { use_ok( 'IO::Socket::Multicast6' ); }
The side effect of this is to import all exports from IO::Socket::Multicast6.
Which, from the above chain of inheritance, is @Socket::EXPORT.
So at this point, main::inet_pton is rebound to Socket::inet_pton
And the test fails, because they differ, and it expected (and wanted)
Socket6::inet_pton(). Socket6::inet_pton() returns 4 bytes for AF_INET, 16
bytes for AF_INET6. Socket::inet_pton() returns 16 for both.
Socket::pack_sockaddr_in() wants 4 bytes.
Now, to add to the fun:
use IO::Socket::Multicast6 ();
and
use IO::Socket::Multicast6;
of course mean different things. The former suppresses all exports.
It turns out that with Test::More::isa_ok() has no way of doing the former:
$ cat use_ok.pl
use warnings;
use strict;
use Test::More tests => 3;
package clash;
BEGIN { main::use_ok 'Socket' };
package crunch;
BEGIN { main::use_ok 'Socket', () };
package biff;
BEGIN { main::use_ok 'Socket', 'sockaddr_family' };
package main;
sub dump_lowercase_keys {
my $package = shift;
print "For package $package:\n";
no strict 'refs';
print " $_\n" foreach sort grep {!tr/A-Z//} keys %{"${package}::"};
print "\n";
}
dump_lowercase_keys $_ foreach qw (clash crunch biff);
__END__
$ perl use_ok.pl
1..3
ok 1 - use Socket;
ok 2 - use Socket;
ok 3 - use Socket;
For package clash:
inet_aton
inet_ntoa
pack_sockaddr_in
pack_sockaddr_un
sockaddr_family
sockaddr_in
sockaddr_un
unpack_sockaddr_in
unpack_sockaddr_un
For package crunch:
inet_aton
inet_ntoa
pack_sockaddr_in
pack_sockaddr_un
sockaddr_family
sockaddr_in
sockaddr_un
unpack_sockaddr_in
unpack_sockaddr_un
For package biff:
sockaddr_family
So, there's no clean way to rewrite that test with use_ok to suppress imports.
So, to summarise, it's due to
A cascade of modules blindly exporting everything that Socket exports
Socket::inet_pton() and Socket6::inet_pton() differing in behaviour
A test that fails to realise that it's importing everything via use_ok
This one ranks as blocker because:
Socket::inet_pton() and Socket::inet_ntop() are not in any stable release
Hence we have the option to change them if we do it *NOW*.
I think that the right fix is the appended patch. This makes the new Socket
implementation of inet_pton consistent with the existing Socket6
implementation of inet_pton.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
$ ./perl -lwe '$a = ${qr//}; $a = 2; print re::is_regexp(\$a)'
1
It is possible for arbitrary SVs (eg PAD entries) to be upgraded to
SVt_REGEXP. (This is new with first class regexps)
Whilst the example above does not SEGV, it will be possible to write
code that will cause SEGVs (or worse) at the point when the scalar is freed,
because the code in sv_clear() assumes that all scalars of type
SVt_REGEXP *are* regexps, and passes them to pregfree2(), which assumes that
pointers within are valid.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
blessing filehandles into FileHandle
It turns out that it's not quite as simple as blessing into IO::File.
If you do (just) that, then it breaks any existing code that does
C<require IO::Handle;> to allow it to call methods on file handles,
because they're blessed into IO::File, which isn't loaded. (Note this code
doesn't assume that methods in IO::Seekable are there to be called)
So, it all should work if you also set @IO::File:::ISA correctly?
That way, code that assumes that methods from IO::Handle can be called will
work. However, gv.c now starts complaining (but not failing) if IO::Handle,
IO::Seekable and Exporter aren't present, because it goes looking for
methods in them.
So the solution seems to be to set @IO::File::ISA *and* create (empty)
stashes for the other 3 packages. Patch appended, but not applied.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Date: Thu, 07 Jan 2010 00:36:25 -0800
Message-ID: <rt-3.6.HEAD-1505-1262853384-1207.71676-15-0@perl.org>
Tweaked as suggested in:
From: "H.Merijn Brand" <h.m.brand@xs4all.nl>
Date: Fri, 8 Jan 2010 13:35:17 +0100
Message-ID: <20100108133517.1f2916d3@pc09.procura.nl>
|