Nicholas Clark [Tue, 30 Nov 2010 15:51:10 +0000 (15:51 +0000)]
Restore building Encode's subextensions for a static build.
The special-casing in Configure still referred to ext/Encode, so likely this
was broken when Encode moved to cpan/
Fixes #79494, reported by Marc Lehmann.
Nicholas Clark [Tue, 30 Nov 2010 13:16:11 +0000 (13:16 +0000)]
In S_scan_const(), use my_snprintf() instead of my_sprintf().
Paranoid linkers warn about using sprintf(), and rightly so.
Father Chrysostomos [Tue, 30 Nov 2010 13:01:25 +0000 (05:01 -0800)]
Use ' to avoid interpolation
Nick Cleaton [Tue, 30 Nov 2010 06:26:43 +0000 (22:26 -0800)]
[perl #79152] super-linear cache can prevent a valid match
The super-linear cache in regexec.c can prevent a valid match
from being detected. For example:
print "yay\n" if 'xayxay' =~ /(q1|.)*(q2|.)*(x(a|bc)*y){2,}/;
This should match, but it doesn't because the cache fails to
distinguish between matching the final xay to x(a|bc)*y as the
first instance of the {2,} and matching it in the same position
as the second instance.
This seems to do the trick.
Peter John Acklam [Mon, 29 Nov 2010 15:00:07 +0000 (16:00 +0100)]
Spelling: reminder -> remainder
Florian Ragwitz [Thu, 25 Nov 2010 01:53:40 +0000 (02:53 +0100)]
Update perlguts for sv_unmagicext and mg_findext
Florian Ragwitz [Thu, 25 Nov 2010 01:40:16 +0000 (02:40 +0100)]
Add tests for sv_{,un}magicext and mg_findext
Florian Ragwitz [Thu, 25 Nov 2010 01:40:00 +0000 (02:40 +0100)]
Add mg_findext
Florian Ragwitz [Thu, 25 Nov 2010 00:06:27 +0000 (01:06 +0100)]
Add sv_unmagicext
Florian Ragwitz [Tue, 30 Nov 2010 09:24:26 +0000 (10:24 +0100)]
Eliminate strlen and strEQ usage in gv_fetchmethod
This commit brought to you with the aid of the campaign for elimination of
strlen().
Father Chrysostomos [Tue, 30 Nov 2010 06:23:12 +0000 (22:23 -0800)]
Another oops.
Something else changed unnecessarily by
541ed3a9. I really oughtn’t do
this when I’ve been awake for more than 18 hours....
Father Chrysostomos [Tue, 30 Nov 2010 05:56:25 +0000 (21:56 -0800)]
Oops.
That was part of my first attempt to fix [perl #68560]. I forgot to
delete it. (It’s harmless.)
Father Chrysostomos [Tue, 30 Nov 2010 05:50:59 +0000 (21:50 -0800)]
perldelta entry for [perl #68560]
Father Chrysostomos [Tue, 30 Nov 2010 05:43:52 +0000 (21:43 -0800)]
[perl #68560] calling closure prototype SEGVs
When a closure is created, the original sub is cloned (except that the
op tree is shared). That original sub (called the closure prototype)
is not usually accessible to perl.
An attribute handler (MODIFY_CODE_ATTRIBUTES) is passed a reference
to it, however. If that code reference is called within the attribute
handler, an ‘Undefined subroutine called’ error results, because the
op tree has not been attached yet.
If that code reference is stashed away and called after the attribute
handler returns, it will most likely crash.
This is because its pad is full of nulls.
A regular $proto->() or &$proto() call that sets up @_ will crash in
attempting to do so.
A &$proto call will bypass that, but attempting to read any lexical
variables from the containing scope will cause a crash. Any operator
that uses TARG (i.e., most of them) will crash.
So this commit puts a check for closure prototypes in pp_entersub. It
produces a new error message, ‘Closure prototype called’.
This does introduce a backward-incompatible change: code like this
used to work:
sub MODIFY_CODE_ATTRIBUTES { $'proto = $_[1] }
{ my $x; () = sub :attr { () = $x; print "hello\n" } }
&$'proto;
But writing a useful subroutine that tiptoes past the crashes is so
difficult that I think this breakage is acceptable.
Jan Dubois [Tue, 30 Nov 2010 01:10:02 +0000 (17:10 -0800)]
Use default stack size on Windows
Perl used to request 16MB of stack instead of the default 1MB (when
compiling with VC++). I believe this was done to accomodate the
recursive nature of the regex engine, which is no longer a concern
since 5.10. The requested stack size will be reserved for each
thread created by the process, not just for the main thread.
Note also that we don't explicitly specify the stack size when
compiling with GCC on Windows (MinGW), which reserves a stack size of
2MB by default.
Chris 'BinGOs' Williams [Mon, 29 Nov 2010 22:14:25 +0000 (22:14 +0000)]
Change the default for usemymalloc to 'n' for NetBSD
It should not be the default, it isn't the default when perl is
built in pkgsrc and from personal experience using perl's malloc
as the default is to enter a world of pain and suffering.
David Golden [Mon, 29 Nov 2010 04:12:12 +0000 (23:12 -0500)]
Filehandle method calls load IO::File on demand
When a method call on a filehandle would die because the method can not
be resolved and L<IO::File> has not been loaded, Perl now loads IO::File
via C<require> and attempts method resolution again:
open my $fh, ">", $file;
$fh->binmode(":raw"); # loads IO::File and succeeds
This also works for globs like STDOUT, STDERR and STDIN:
STDOUT->autoflush(1);
Because this on-demand load only happens if method resolution fails, the
legacy approach of manually loading an IO::File parent class for partial
method support still works as expected:
use IO::Handle;
open my $fh, ">", $file;
$fh->autoflush(1); # IO::File not loaded
Nicholas Clark [Mon, 29 Nov 2010 19:19:21 +0000 (19:19 +0000)]
Following
fbcaf61123069fe4, remove perlmain.c from the initial list of C files.
Otherwise miniperl gets built by ./makedepend, as it calls `make clist`,
clist depends on the initial list of C files, and perlmain.c has rules to
(re)build it which depend on miniperl.
There is no dependency problem with removing perlmain.c from the list of C
files, and hence the list of files for which makefile dependency rules are
generated, as its (new) dependency on miniperl means that it will always be
rebuilt if miniperl is rebuilt, and in turn miniperl will always be rebuilt
it miniperlmain.o is out of date. perlmain.o has the same dependencies as
miniperlmain.o, so the requirement to rebuild is always satisfied.
Thanks to Florian Ragwitz for spotting this problem.
Florian Ragwitz [Mon, 29 Nov 2010 18:37:25 +0000 (19:37 +0100)]
Fix a typo in perlmod
Florian Ragwitz [Mon, 29 Nov 2010 17:43:06 +0000 (18:43 +0100)]
Upgrade Memoize from version 1.01_03 to 1.02
Nicholas Clark [Mon, 29 Nov 2010 15:17:54 +0000 (15:17 +0000)]
Add a verbose option to -DP, and replace C<#if 0> blocks in sv_gets() with it.
Nicholas Clark [Mon, 29 Nov 2010 14:13:03 +0000 (14:13 +0000)]
In Perl_sv_gets(), shortbuffered is always 0 when rslen is 0.
Hence we can jump past the test C<if (shortbuffered)> after the "this screams
louder" block, as that is only reached where rslen is 0.
Father Chrysostomos [Mon, 29 Nov 2010 14:09:37 +0000 (06:09 -0800)]
perldelta entry for [perl #63540]
Father Chrysostomos [Mon, 29 Nov 2010 14:05:35 +0000 (06:05 -0800)]
[perl #63540] bizarre closure lossage
main::b in this example shows a null op that has the if() statement
attached to it.
$ perl -MO=Concise,a,b -e 'my $x;sub a {$x}; sub b{if($x){}0}'
main::a:
3 <1> leavesub[1 ref] K/REFC,1 ->(end)
- <@> lineseq KP ->3
1 <;> nextstate(main 2 -e:1) v ->2
2 <0> padsv[$x:FAKE:] ->3
main::b:
a <1> leavesub[1 ref] K/REFC,1 ->(end)
- <@> lineseq KP ->a
4 <;> nextstate(main 5 -e:1) v ->5
- <1> null vK/1 ->8
6 <|> and(other->7) vK/1 ->8
5 <0> padsv[$x:FAKE:] s ->6
- <@> scope vK ->-
7 <0> stub v ->8
8 <;> nextstate(main 5 -e:1) v ->9
9 <$> const[IV 0] s ->a
-e syntax OK
Perl_op_const_sv has:
if (type == OP_NEXTSTATE || type == OP_NULL || type == OP_PUSHMARK)
continue;
It traverses from the null to the const. The const’s op_next pointer
points to the leavesub, so it is taken to be a constant.
It returns to newATTRSUB, which turns on CvCONST without assigning a
constant value.
Later, cv_clone (called by pp_anoncode) calls op_const_sv again. The
latter returns the SV from the first PADSV it finds, which is the $x
in if($x).
This commit stops op_const_sv from skipping over null ops that
have children.
Nicholas Clark [Mon, 29 Nov 2010 11:41:21 +0000 (11:41 +0000)]
Break out code from Perl_sv_gets() which is self contained and exits directly.
Previously the code for handling fixed length records, and appending from a
non-UTF-8 handle to a UTF-8 scalar, was handled in two blocks in Perl_sv_gets()
which exited via a goto to the last statement of Perl_sv_gets(). By breaking
them out into separate static functions, the control flow becomes clearer.
Tony Cook [Mon, 29 Nov 2010 11:36:35 +0000 (22:36 +1100)]
Fix C++ build problems introduced in
9a5a5549
Fixes the following compilation errors:
regexec.c: In function 'char* S_find_byclass(regexp*, const regnode*, char*,
const char*, regmatch_info*)':
regexec.c:1525: error: invalid conversion from 'I32 (*)(const char*, const
char*, I32)' to 'I32 (*)()'
regexec.c:1525: error: too many arguments to function
regexec.c:1527: error: invalid conversion from 'I32 (*)(const char*, const
char*, I32)' to 'I32 (*)()'
regexec.c:1527: error: too many arguments to function
David Mitchell [Mon, 29 Nov 2010 11:23:28 +0000 (11:23 +0000)]
document why eintr.t needs to be skipped on Win32
David Mitchell [Mon, 29 Nov 2010 10:36:19 +0000 (10:36 +0000)]
in perlipc, 'named pipes' was in signals section
Move the '=head1 Named Pipes' section down so that it's no longer nested,
cuckoo-like, in the middle of the '=head1 Signals' section.
Father Chrysostomos [Sun, 28 Nov 2010 22:10:44 +0000 (14:10 -0800)]
perldelta: The last few commits are not noteworthy
except for one that already has an entry.
Father Chrysostomos [Sun, 28 Nov 2010 22:01:21 +0000 (14:01 -0800)]
Lukas Mai [Mon, 29 Nov 2010 05:56:44 +0000 (21:56 -0800)]
[perl #79914] documentation bug in perldoc perlvar $|
Father Chrysostomos [Mon, 29 Nov 2010 05:56:37 +0000 (21:56 -0800)]
AUTHORS: e-mail addr for Lukas Mai
Craig A. Berry [Sun, 28 Nov 2010 22:49:23 +0000 (16:49 -0600)]
Make vms/writemain.pl go the way of writemain.SH.
Follow-up to
fbcaf61123069fe46010699dd41ca5f60f448361 at Nicholas's
suggestion.
Nicholas Clark [Sun, 28 Nov 2010 21:45:22 +0000 (21:45 +0000)]
Correct a copy&pasto - := is now an error, and no longer a warning.
Father Chrysostomos [Sun, 28 Nov 2010 20:43:03 +0000 (12:43 -0800)]
Nicholas Clark [Fri, 26 Nov 2010 15:53:56 +0000 (15:53 +0000)]
Make my $pi := 4; a syntax error.
Previously it interpreted := as an empty attribute list, and issued a
deprecation warning. This change permits := to be used as a binding operator.
Father Chrysostomos [Sun, 28 Nov 2010 19:05:29 +0000 (11:05 -0800)]
brian d foy [Sun, 28 Nov 2010 19:35:43 +0000 (13:35 -0600)]
perlfaq5: How do I make a temporary file name?
Fixed up a half-completed change from typeglobs to lexical
filehandles.
Nicholas Clark [Sun, 28 Nov 2010 19:03:21 +0000 (19:03 +0000)]
Remove makeaperl, never used, a wrapper for ExtUtils::MakeMaker::makeaperl
makeaperl was added in perl5.000k, wrapped as makeaperl.SH in perl5.000l, but
neither used in the core build nor installed. All it does is acts as a
command-line wrapper to makeaperl() in ExtUtils::MakeMaker.
Father Chrysostomos [Sun, 28 Nov 2010 18:54:49 +0000 (10:54 -0800)]
++substr $re::VERSION, -1
Andreas J. Koenig [Sun, 28 Nov 2010 18:53:39 +0000 (10:53 -0800)]
Tiny pod fix
Father Chrysostomos [Sun, 28 Nov 2010 18:48:45 +0000 (10:48 -0800)]
David Mitchell [Sun, 28 Nov 2010 18:33:51 +0000 (18:33 +0000)]
disable t/io/eintr.t on windows
Apperently it's causing smokers to hang, so skip until
I find out what's happening.
Nicholas Clark [Sun, 28 Nov 2010 17:15:58 +0000 (17:15 +0000)]
Generate perlmain.c using ExtUtils::Miniperl, instead of writemain.SH.
This allows writemain.SH to be removed. This also has the side effect of testing
that ExtUtils::Miniperl actually works. :-)
Craig A. Berry [Sun, 28 Nov 2010 15:59:25 +0000 (09:59 -0600)]
Skip eintr.t on VMS.
It's doing select() on a pipe, but only sockets work with select(),
and the read() on a pipe is not interruptible by an alarm. That's
probably because our pipe implementation is doing mailbox reads at
AST level but the alarm signal is also an AST and can't interrupt
another AST at the same mode.
Nicholas Clark [Sun, 28 Nov 2010 15:52:58 +0000 (15:52 +0000)]
Proper Makefile dependencies for the x2p/s2p rule.
Without this, a parallel make for a static build can fail, as x2p/Makefile
uses ../perl for a static build, but there was no rule to ensure that ../perl
was built.
A static build currently still fails some tests, I think because Encode doesn't
link all encodings staticly.
Rafael Garcia-Suarez [Sun, 28 Nov 2010 14:01:24 +0000 (15:01 +0100)]
Revert "Configure has a path to less and perl5db.pl can use it"
This reverts commit
bf320d637919b3a2a72298748aa76e686e9b3e45.
Andy Dougherty points out that after Configure has run, the "less"
config variable is no longer useful, as described in Porting/Glossary.
Karl Williamson [Sun, 28 Nov 2010 05:14:05 +0000 (22:14 -0700)]
reg_fold.t: Add tests for simple Latin1 folds
fold_grind.t does a comprehensive series of tests, but it doesn't test
most characters, just a representative sample. Add tests to reg_fold.t
to verify that the basic mapping tables work.
Karl Williamson [Sun, 28 Nov 2010 05:12:13 +0000 (22:12 -0700)]
reg_fold.t: Disable single char fold testing
This is now more comprehensively done by fold_grind.t
Karl Williamson [Sun, 28 Nov 2010 05:10:35 +0000 (22:10 -0700)]
fold_grind.t: Enable EXACTish tests
Karl Williamson [Sun, 28 Nov 2010 05:08:57 +0000 (22:08 -0700)]
test.pl: Add native to uni ord fcns
Karl Williamson [Sun, 28 Nov 2010 04:16:51 +0000 (21:16 -0700)]
regcomp.c: Handle EXACTFU nodes in optimizer
This patch also changes the optimizer to include the other member of a
fold pair in the bitmap. Thus if 'b' is set under /i, so will 'B', and
vice versa.
Karl Williamson [Sun, 28 Nov 2010 03:51:54 +0000 (20:51 -0700)]
regcomp.c: Use hex instead of octal for debug ords
The ordinals that are output in the debugging output have been in octal,
which is ok for the low controls, but for above Latin1, the standard is
hex, so this changes them all to correspond. If desired the low
controls could be changed back to be in octal.
Karl Williamson [Sun, 28 Nov 2010 03:49:49 +0000 (20:49 -0700)]
Fix debug output
The 'outside bitmap' message isn't orthogonal to the others, it is
independent.
Karl Williamson [Sun, 28 Nov 2010 03:45:33 +0000 (20:45 -0700)]
regcomp.c: Typo in comment
Karl Williamson [Sun, 28 Nov 2010 03:37:05 +0000 (20:37 -0700)]
regcomp.c: Generate EXACTFU nodes
Karl Williamson [Sun, 28 Nov 2010 02:40:58 +0000 (19:40 -0700)]
regcomp.c: remove unnecessary tests
The tests in the else are unnecessary as they comprise everything else
but what the 'if' says.
Karl Williamson [Sat, 27 Nov 2010 22:26:31 +0000 (15:26 -0700)]
regexec.c: Add handling for EXACTFU nodes
A later commit will cause these nodes to be generated.
This commit changes how to find the handling of the various nodes to
switch statements, hopefully for efficiency.
Karl Williamson [Sat, 27 Nov 2010 22:19:31 +0000 (15:19 -0700)]
regexec.c: pull array lookup out of loop
Karl Williamson [Sat, 27 Nov 2010 22:16:47 +0000 (15:16 -0700)]
utf8.h: Add #define for Greek small MU
Karl Williamson [Sat, 27 Nov 2010 22:08:34 +0000 (15:08 -0700)]
regexec.c: clarify comments
Karl Williamson [Sat, 27 Nov 2010 17:57:01 +0000 (10:57 -0700)]
regcomp.sym: Add EXACTFU regnode
This node will be used for matching case insensitive exactish nodes
using Unicode semantics
Karl Williamson [Sat, 27 Nov 2010 17:26:01 +0000 (10:26 -0700)]
regexec.c: Latin1 chars can fold match UTF8_ALL
Some ANYOF regnodes have the ANYOF_UNICODE_ALL flag set, which means
they match any non-Latin1 character. These should match /i (in a utf8
target string) any ASCII or Latin1 character that folds outside the
Latin1 range
As part of this patch, an internal only macro is renamed to account for its
new use in regexec.c. The cumbersome name is to ward off others from
using it until the final semantics have been settled on.
Karl Williamson [Sat, 27 Nov 2010 17:10:52 +0000 (10:10 -0700)]
fold_grind.t: Make unicode semantics pattern differently
This changes to use 'use re "/u"' to specify that a pattern is supposed
to match with unicode semantics, instead of upgrading it to utf8. The
variable name changes accordingly
Karl Williamson [Sat, 27 Nov 2010 16:42:48 +0000 (09:42 -0700)]
Add Perl_foldEQ_latin1()
This function compares two non-utf8 strings to see if they are
equivalent without regards to case differences. It does not work nor
check for three problematic code points that require special handling:
MICRO_SIGN, LATIN_SMALL_LETTER_SHARP_S, and
LATIN_SMALL_LETTER_Y_WITH_DIAERESIS.
make regen required
Father Chrysostomos [Sun, 28 Nov 2010 07:52:44 +0000 (23:52 -0800)]
perldelta for 04698ff
Father Chrysostomos [Sun, 28 Nov 2010 07:46:26 +0000 (23:46 -0800)]
Father Chrysostomos [Sun, 28 Nov 2010 07:38:43 +0000 (23:38 -0800)]
John Peacock [Sun, 28 Nov 2010 06:05:41 +0000 (22:05 -0800)]
Bring core Perl in line with CPAN 0.86 release
Attached is a patch that bring the core Perl version code inline with
the latest CPAN release. The vast majority of changes are in code that
does not execute in core, but that makes it easier to keep the core and
CPAN changes in sync.
Father Chrysostomos [Sat, 27 Nov 2010 21:46:32 +0000 (13:46 -0800)]
Add Socket version numbers to perldelta
Father Chrysostomos [Sat, 27 Nov 2010 21:45:58 +0000 (13:45 -0800)]
Increase Socket.pm’s version
Father Chrysostomos [Sat, 27 Nov 2010 21:25:07 +0000 (13:25 -0800)]
Father Chrysostomos [Sat, 27 Nov 2010 21:02:49 +0000 (13:02 -0800)]
Suppress test warning added by
04698ff6
Father Chrysostomos [Sat, 27 Nov 2010 21:05:16 +0000 (13:05 -0800)]
Make *ISA assignment slightly faster
Since we already know the array is magical and we already
have a pointer to the magic half the time, we can call
Perl_magic_clearisa directly.
Craig A. Berry [Sat, 27 Nov 2010 15:50:30 +0000 (09:50 -0600)]
Father Chrysostomos [Sat, 27 Nov 2010 15:43:18 +0000 (07:43 -0800)]
Increase PerlIO::scalar’s version
Father Chrysostomos [Sat, 27 Nov 2010 15:13:13 +0000 (07:13 -0800)]
mro.c: Assert that the previous commit is correct
Father Chrysostomos [Sat, 27 Nov 2010 15:11:20 +0000 (07:11 -0800)]
Avoid a redundant check in mro.c
This code is never reached if oldstash is a hash without an HvENAME.
So instead of checking oldstash in the ?:, then hvename in the if(),
we can do one check.
If oldstash is no longer in the symbol table, then this code is never
reached, because of the if(!fetched_isarev) guard.
Father Chrysostomos [Sat, 27 Nov 2010 14:42:52 +0000 (06:42 -0800)]
Increase overload.pm’s version
Michael Fig [Sat, 27 Nov 2010 13:44:26 +0000 (05:44 -0800)]
[perl #79680] overload 1.10 sprintf fails taint checking
[Note from the committer: I cannot reproduce the bug this is intended
to fix. I suspect the author has a botched Scalar::Util installation.
But it *does* make the code go faster, as it uses fewer ops. That’s my
reason for appling it.]
Father Chrysostomos [Sat, 27 Nov 2010 14:41:40 +0000 (06:41 -0800)]
Add Michael Fig to AUTHORS
Father Chrysostomos [Sat, 27 Nov 2010 13:40:53 +0000 (05:40 -0800)]
[perl #78716] Bogus read after seek beyond end of string
This is a signedness problem that
ffe0bb5ab did not take into account.
(STRLEN)-10 > 0 returns true for me.
Father Chrysostomos [Sat, 27 Nov 2010 14:39:19 +0000 (06:39 -0800)]
Add Devel:: to the -d:- perldelta entry
Father Chrysostomos [Sat, 27 Nov 2010 14:37:58 +0000 (06:37 -0800)]
Father Chrysostomos [Sat, 27 Nov 2010 14:22:24 +0000 (06:22 -0800)]
[perl #79178] STORE/FETCH of tie()d hash get stringified key
This bug has been present in non-threaded builds for a long time.
Change
38bb37b9aa introduced it to threaded builds.
$hash{...} makes its operand a shared-PV scalar if it is an OP_CONST.
But \"foo" is also an OP_CONST, as is anything generated with use
constant. This is the sort of thing that results:
$ perl5.8.5 -MO=Concise -e '$a{\"foo"}'
7 <@> leave[1 ref] vKP/REFC ->(end)
1 <0> enter ->2
2 <;> nextstate(main 1 -e:1) v ->3
6 <2> helem vK/2 ->7
4 <1> rv2hv sKR/1 ->5
3 <$> gv(*a) s ->4
5 <$> const(PVIV "SCALAR(0x81b378)") s ->6
-e syntax OK
(My 5.8.5 installation is non-threaded.)
See the "SCALAR(0x81b378)" in there?
So this commit skips that optimisation if the key is ROK or if it is a
PVMG or higher.
Rafael Garcia-Suarez [Sat, 27 Nov 2010 14:47:44 +0000 (15:47 +0100)]
Fix a warning (that spotted a potential mro bug that I could not produce)
Craig A. Berry [Sat, 27 Nov 2010 00:45:24 +0000 (18:45 -0600)]
Skip multi-arg piped open in autodie test on VMS.
Awaiting upstream integration at:
https://rt.cpan.org/Ticket/Display.html?id=59123
Craig A. Berry [Sat, 27 Nov 2010 00:33:54 +0000 (18:33 -0600)]
Skip t/porting/FindExt.t on VMS.
win32::FindExt doesn't work on VMS, but it's only intended to work
on Windows, so there's not much reason to port it or to test it.
Craig A. Berry [Sat, 27 Nov 2010 00:29:42 +0000 (18:29 -0600)]
Fix Time::HiRes probes on VMS.
We have not been correctly building this on VMS since the location
was changed in core because we have not been able to loate include
files. This mirrors the upstream patch at:
https://rt.cpan.org/Ticket/Display.html?id=63363
Father Chrysostomos [Fri, 26 Nov 2010 23:52:54 +0000 (15:52 -0800)]
[perl #78908] Reinstate mod for one more stable release
Chris 'BinGOs' Williams [Fri, 26 Nov 2010 23:24:22 +0000 (23:24 +0000)]
Update MIME-Base64 to CPAN version 3.13
[DELTA]
2010-10-26 Gisle Aas <gisle@ActiveState.com>
Release 3.13
The fix in v3.12 to try to preserve the SvUTF8 flag was buggy
and actually managed to set the flag on strings that did not
have it originally.
This resolves the test failures for Encode::Encoder
Father Chrysostomos [Fri, 26 Nov 2010 22:51:07 +0000 (14:51 -0800)]
Clarify op_lvalue’s docs
as requested by Reini Urban [perl #78908]
Father Chrysostomos [Fri, 26 Nov 2010 22:24:30 +0000 (14:24 -0800)]
[perl #78810] PERLDB_NOOPT ignored by adjacent nextstate optimisation
As mentioned in the RT ticket, ac56e7d did not take PERLDB_NOOPT
into account.
Rafael Garcia-Suarez [Fri, 26 Nov 2010 22:30:06 +0000 (23:30 +0100)]
No need to nest printfs. DIE() takes format strings.
Father Chrysostomos [Fri, 26 Nov 2010 22:00:56 +0000 (14:00 -0800)]
Fix compiler warning
Father Chrysostomos [Fri, 26 Nov 2010 20:44:43 +0000 (12:44 -0800)]
Avoid redundant hv_delete call in pp_entereval
This commit just avoids a redundant hv_delete call if leave_scope is
already going to do it.
Father Chrysostomos [Fri, 26 Nov 2010 15:22:47 +0000 (07:22 -0800)]
[perl #78634] Conflict in defining constant INIT
When gv_init tries to turn a constant named INIT into a CV, the auto-
matic special processing of the INIT ‘block’ kicks in, which removes
the CV from the GV.
This should not happen with gv_init, as $::{INIT} = \5 is supposed
to be equivalent to *INIT = sub(){5}, which does not do that.
This commit makes gv_init check for that, increase the reference
count, and reassign the CV. It does not stop the CV from being called
as a special block, but it is harmless to call a constant CV.
David Mitchell [Mon, 22 Nov 2010 19:18:49 +0000 (19:18 +0000)]
Make PerlIO marginally reentrant
Currently if an operation on a file handle is interrupted, and if
the signal handler accesses that same file handle (e.g. closes it),
then perl will crash. See [perl #75556].
This commit provides some basic infrastructure to avoid segfaults.
Basically it adds a lock count field to each handle (by re-purposing the
unused flags field in the PL_perlio array), then each time a signal
handler is called, the count is incremented. Then various parts of PerlIO
use a positive count to change behaviour. Most importantly, when layers
are popped, the PerlIOl structure is cleared, but not freed, and is left
in the chain of layers. This means that callers still holding pointers to
the various layers won't access freed structures. It does however mean
that PerlIOl structs may be leaked, and possibly slots in PL_perlio. But
this is better than crashing.
Not much has been done to give sensible behaviour on re-entrancy; for
example, a buffer that has already been written once might get written
again. Fixing this sort of thing would require a large-scale audit of
perlio.c.
David Mitchell [Fri, 19 Nov 2010 17:23:17 +0000 (17:23 +0000)]
perlio: always guard against null function table
In some places it already checks for a null tab field; extend that
coverage. This is in preparation for a commit which may leave active
layers with a null tab field.
David Mitchell [Wed, 17 Nov 2010 16:29:04 +0000 (16:29 +0000)]
add PerlIO_init_table() to initialise PL_perio
Previously, the PL_perio table was initialised by calling PerlIO_allocate,
and throwing away the result. Since a slot with a null ->next was regarded
as freed, the next call to PerlIO_allocate would reuse that slot, which is
important, as STDIN etc are expected to occupy slots 1,2,3.
Once reference counting of the slots is introduced, however, the first
slot will leak, and STDIN etc will be assigned to the wrong slots. So do it
properly now.