This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perl5.git
11 years ago++substr $re::VERSION, -1
Father Chrysostomos [Sun, 28 Nov 2010 18:54:49 +0000 (10:54 -0800)]
++substr $re::VERSION, -1

11 years agoTiny pod fix
Andreas J. Koenig [Sun, 28 Nov 2010 18:53:39 +0000 (10:53 -0800)]
Tiny pod fix

11 years agoperldelta up to 8e747b69
Father Chrysostomos [Sun, 28 Nov 2010 18:48:45 +0000 (10:48 -0800)]
perldelta up to 8e747b69

11 years agodisable t/io/eintr.t on windows
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.

11 years agoGenerate perlmain.c using ExtUtils::Miniperl, instead of writemain.SH.
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. :-)

11 years agoSkip eintr.t on VMS.
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.

11 years agoProper Makefile dependencies for the x2p/s2p rule.
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.

11 years agoRevert "Configure has a path to less and perl5db.pl can use it"
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.

11 years agoreg_fold.t: Add tests for simple Latin1 folds
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.

11 years agoreg_fold.t: Disable single char fold testing
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

11 years agofold_grind.t: Enable EXACTish tests
Karl Williamson [Sun, 28 Nov 2010 05:10:35 +0000 (22:10 -0700)]
fold_grind.t: Enable EXACTish tests

11 years agotest.pl: Add native to uni ord fcns
Karl Williamson [Sun, 28 Nov 2010 05:08:57 +0000 (22:08 -0700)]
test.pl: Add native to uni ord fcns

11 years agoregcomp.c: Handle EXACTFU nodes in optimizer
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.

11 years agoregcomp.c: Use hex instead of octal for debug ords
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.

11 years agoFix debug output
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.

11 years agoregcomp.c: Typo in comment
Karl Williamson [Sun, 28 Nov 2010 03:45:33 +0000 (20:45 -0700)]
regcomp.c: Typo in comment

11 years agoregcomp.c: Generate EXACTFU nodes
Karl Williamson [Sun, 28 Nov 2010 03:37:05 +0000 (20:37 -0700)]
regcomp.c: Generate EXACTFU nodes

11 years agoregcomp.c: remove unnecessary tests
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.

11 years agoregexec.c: Add handling for EXACTFU nodes
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.

11 years agoregexec.c: pull array lookup out of loop
Karl Williamson [Sat, 27 Nov 2010 22:19:31 +0000 (15:19 -0700)]
regexec.c: pull array lookup out of loop

11 years agoutf8.h: Add #define for Greek small MU
Karl Williamson [Sat, 27 Nov 2010 22:16:47 +0000 (15:16 -0700)]
utf8.h: Add #define for Greek small MU

11 years agoregexec.c: clarify comments
Karl Williamson [Sat, 27 Nov 2010 22:08:34 +0000 (15:08 -0700)]
regexec.c: clarify comments

11 years agoregcomp.sym: Add EXACTFU regnode
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

11 years agoregexec.c: Latin1 chars can fold match UTF8_ALL
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.

11 years agofold_grind.t: Make unicode semantics pattern differently
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

11 years agoAdd Perl_foldEQ_latin1()
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

11 years agoperldelta for 04698ff
Father Chrysostomos [Sun, 28 Nov 2010 07:52:44 +0000 (23:52 -0800)]
perldelta for 04698ff

11 years agoperldelta up to a51ee39b
Father Chrysostomos [Sun, 28 Nov 2010 07:46:26 +0000 (23:46 -0800)]
perldelta up to a51ee39b

11 years agoperldelta up to abf9167d
Father Chrysostomos [Sun, 28 Nov 2010 07:38:43 +0000 (23:38 -0800)]
perldelta up to abf9167d

11 years agoBring core Perl in line with CPAN 0.86 release
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.

11 years agoAdd Socket version numbers to perldelta
Father Chrysostomos [Sat, 27 Nov 2010 21:46:32 +0000 (13:46 -0800)]
Add Socket version numbers to perldelta

11 years agoIncrease Socket.pm’s version
Father Chrysostomos [Sat, 27 Nov 2010 21:45:58 +0000 (13:45 -0800)]
Increase Socket.pm’s version

11 years agoperldelta up to 2a25d7b6
Father Chrysostomos [Sat, 27 Nov 2010 21:25:07 +0000 (13:25 -0800)]
perldelta up to 2a25d7b6

11 years agoSuppress test warning added by 04698ff6
Father Chrysostomos [Sat, 27 Nov 2010 21:02:49 +0000 (13:02 -0800)]
Suppress test warning added by 04698ff6

11 years agoMake *ISA assignment slightly faster
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.

11 years agoBump Time::HiRes version after 4edfaa8809ab489b9ce1c7936973edc2c80216db.
Craig A. Berry [Sat, 27 Nov 2010 15:50:30 +0000 (09:50 -0600)]
Bump Time::HiRes version after 4edfaa8809ab489b9ce1c7936973edc2c80216db.

11 years agoIncrease PerlIO::scalar’s version
Father Chrysostomos [Sat, 27 Nov 2010 15:43:18 +0000 (07:43 -0800)]
Increase PerlIO::scalar’s version

11 years agomro.c: Assert that the previous commit is correct
Father Chrysostomos [Sat, 27 Nov 2010 15:13:13 +0000 (07:13 -0800)]
mro.c: Assert that the previous commit is correct

11 years agoAvoid a redundant check in mro.c
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.

11 years agoIncrease overload.pm’s version
Father Chrysostomos [Sat, 27 Nov 2010 14:42:52 +0000 (06:42 -0800)]
Increase overload.pm’s version

11 years ago[perl #79680] overload 1.10 sprintf fails taint checking
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.]

11 years agoAdd Michael Fig to AUTHORS
Father Chrysostomos [Sat, 27 Nov 2010 14:41:40 +0000 (06:41 -0800)]
Add Michael Fig to AUTHORS

11 years ago[perl #78716] Bogus read after seek beyond end of string
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.

11 years agoAdd Devel:: to the -d:- perldelta entry
Father Chrysostomos [Sat, 27 Nov 2010 14:39:19 +0000 (06:39 -0800)]
Add Devel:: to the -d:- perldelta entry

11 years agoperldelta up to a3179684
Father Chrysostomos [Sat, 27 Nov 2010 14:37:58 +0000 (06:37 -0800)]
perldelta up to a3179684

11 years ago[perl #79178] STORE/FETCH of tie()d hash get stringified key
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.

11 years agoFix a warning (that spotted a potential mro bug that I could not produce)
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)

11 years agoSkip multi-arg piped open in autodie test on VMS.
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

11 years agoSkip t/porting/FindExt.t on VMS.
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.

11 years agoFix Time::HiRes probes on VMS.
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

11 years ago[perl #78908] Reinstate mod for one more stable release
Father Chrysostomos [Fri, 26 Nov 2010 23:52:54 +0000 (15:52 -0800)]
[perl #78908] Reinstate mod for one more stable release

11 years agoUpdate MIME-Base64 to CPAN version 3.13
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

11 years agoClarify op_lvalue’s docs
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]

11 years ago[perl #78810] PERLDB_NOOPT ignored by adjacent nextstate optimisation
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.

11 years agoNo need to nest printfs. DIE() takes format strings.
Rafael Garcia-Suarez [Fri, 26 Nov 2010 22:30:06 +0000 (23:30 +0100)]
No need to nest printfs. DIE() takes format strings.

11 years agoFix compiler warning
Father Chrysostomos [Fri, 26 Nov 2010 22:00:56 +0000 (14:00 -0800)]
Fix compiler warning

11 years agoAvoid redundant hv_delete call in pp_entereval
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.

11 years ago[perl #78634] Conflict in defining constant INIT
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.

11 years agoMake PerlIO marginally reentrant
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.

11 years agoperlio: always guard against null function table
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.

11 years agoadd PerlIO_init_table() to initialise PL_perio
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.

11 years agoadd 'head' field to PerlIOl struct
David Mitchell [Tue, 16 Nov 2010 22:44:34 +0000 (22:44 +0000)]
add 'head' field to PerlIOl struct

This allows any layer to find the top of the layer stack,
or more specifically, the entry in PL_perlio that points to
the top.

Needed for the next commit, which will implement a reference counting
scheme.

There's currently a bug in MakeMaker which causes several extensions to
miss the dependency on perliol.h having changed, so this commit includes
a gratuitous whitespace change to perl.h to hopefully force recompilation.

11 years agomake PL_perlio an array of PerlIOl, not PerlIO *
David Mitchell [Mon, 15 Nov 2010 17:06:37 +0000 (17:06 +0000)]
make PL_perlio an array of PerlIOl, not PerlIO *

Layers in PerlIO are implemented as a linked list of PerlIOl structs;
eaxch one has a 'next' field pointing to the next layer. Now here's the
clever bit: When PerlIO* pointers are passed around to refer to a
particular handle, these are actually pointers to the 'next' field of the
*parent* layer (so to access the flags field say of a PerlIOl, you have to
double-defref it, e.g. (*f)->flags). The big advantage of this is that
it's easy for a layer to pop itself; when you call PerlIO_pop(f), f is a
pointer to the parent's 'next' field, so pop(f) can just do
*f = (*f)->next.

This means that there has to be a fake 'next' field above the topmost
layer. This is where PL_perlio comes in: it's a pointer to an arena of
arrays of pointers, each one capable of pointing to a PerlIOl structure.
When  a new handle is created, a spare arena slot is grabbed, and the
address of that slot is returned. This also allows for a handle with no
layers.

What this commit does is change PL_perlio from being an array of
PerlIO* into an array of PerlIOl structures - i.e. each element in the
array goes from being a single pointer, to having several fields. These
will be made used of in follow-up commits.

11 years agoIn deparse.t, give a description to every test. Remove the test numbers.
Nicholas Clark [Fri, 26 Nov 2010 15:29:07 +0000 (15:29 +0000)]
In deparse.t, give a description to every test. Remove the test numbers.

Pass all test descriptions to Test::More. Remove one duplicated test.

11 years agoStop eval "BEGIN{die}" from leaking
Father Chrysostomos [Fri, 26 Nov 2010 14:25:36 +0000 (06:25 -0800)]
Stop eval "BEGIN{die}" from leaking

This fixes the rest of [perl #78438].

eval "BEGIN{die}" creates a *{"_<(eval 1)"} glob regardless of $^P’s
setting in non-threaded builds as of change f9bddea (5.12.0).

Here are the results with various configurations:

version  threaded  eval text  $^P  Is *{"_<(eval 1)"} set?
-------  --------  ---------  ---  -----------------------
5.10.1   yes       BEGIN{}      0  no
5.10.1   yes       BEGIN{die}   0  no
5.10.1   yes       BEGIN{}    0xA  yes
5.10.1   yes       BEGIN{die} 0xA  no

5.10.1   no        BEGIN{}      0  no
5.10.1   no        BEGIN{die}   0  no
5.10.1   no        BEGIN{}    0xA  yes
5.10.1   no        BEGIN{die} 0xA  no

5.13.7   yes       BEGIN{}      0  no
5.13.7   yes       BEGIN{die}   0  no
5.13.7   yes       BEGIN{}    0xA  yes
5.13.7   yes       BEGIN{die} 0xA  yes

5.13.7   no        BEGIN{}      0  no
5.13.7   no        BEGIN{die}   0  yes
5.13.7   no        BEGIN{}    0xA  yes
5.13.7   no        BEGIN{die} 0xA  yes

Notice that, for non-threaded builds, BEGIN{die} goes from never sav-
ing the text to always saving it.

The commit in question is:

commit f9bddea7d2a0d824366014c8ee6ba57e7dedd8c3
Author: Nicholas Clark <nick@ccl4.org>
Date:   Tue Dec 2 20:43:58 2008 +0000

    Implement PERLDBf_SAVESRC_INVALID, which saves source lines for string
    evals that fail to compile.

    p4raw-id: //depot/perl@34985

It stops unconditionally using the scoping mechanism to delete
$::{"_<(eval $num)"} on compilation failure:

-    safestr = savepvn(tmpbuf, len);
-    SAVEDELETE(PL_defstash, safestr, len);

but instead does it explicitly in this block:

+    if (doeval(gimme, NULL, runcv, seq)) {
+ if (was != PL_breakable_sub_gen /* Some subs defined here. */
+     ? (PERLDB_LINE || PERLDB_SAVESRC)
+     :  PERLDB_SAVESRC_NOSUBS) {
+     /* Retain the filegv we created.  */
+ } else {
+     char *const safestr = savepvn(tmpbuf, len);
+     SAVEDELETE(PL_defstash, safestr, len);
+ }
+ return DOCATCH(PL_eval_start);
+    } else {
+ /* We have already left the scope set up earler thanks to the LEAVE
+    in doeval().  */
+ if (PERLDB_SAVESRC_INVALID) {
+     /* Retain the filegv we created.  */
+ } else {
+     (void)hv_delete(PL_defstash, tmpbuf, len, G_DISCARD);
+ }
+ return PL_op->op_next;
+    }

In the case of BEGIN{die}, that doeval() never returns, so the
clean-up code is not reached.

S_doeval never returns because call_list calls Perl_croak if it
catches a BEGIN error (appending the extra ‘BEGIN failed--compilation
aborted’, etc.). That takes execution all the way back to perl_run, so
it bypasses the clean-up code in pp_entereval.

What’s leaking is the GV created earlier in pp_entereval by this line:

    CopFILE_set(&PL_compiling, tmpbuf+2);

CopFILE_set simply stores a string under threads, but creates a GV
under non-threaded builds.

This commit solves the problem by scheduling a deletion *before* call-
ing doeval, if the source lines have not been saved.

This works because the usual code to handle it is only bypassed when
there is a BEGIN block (a subroutine), so PL_breakable_sub_gen will
have gone up. So we never need to delete the saved lines when that
code is bypassed.

11 years agoSpecial compiler settings only change for 64bitall, not for 64bitint
H.Merijn Brand [Fri, 26 Nov 2010 09:03:46 +0000 (10:03 +0100)]
Special compiler settings only change for 64bitall, not for 64bitint

11 years agoUpdate MIME-Base64 to CPAN version 3.12
Chris 'BinGOs' Williams [Fri, 26 Nov 2010 00:46:37 +0000 (00:46 +0000)]
Update MIME-Base64 to CPAN version 3.12

  [DELTA]

  2010-10-25   Gisle Aas <gisle@ActiveState.com>

   Release 3.12

   Don't change SvUTF8 flag on the strings encoded [RT#60105]

   Documentation tweaks

11 years agoCan't spawn fresh Perl interpreter with an empty PATH
Jan Dubois [Fri, 26 Nov 2010 00:26:51 +0000 (16:26 -0800)]
Can't spawn fresh Perl interpreter with an empty PATH

11 years agoSync win32/Makefile with win32/makefile.mk
Jan Dubois [Thu, 25 Nov 2010 22:26:21 +0000 (14:26 -0800)]
Sync win32/Makefile with win32/makefile.mk

11 years agoPass STATIC_EXT to t/porting/FindExt.t
Jan Dubois [Thu, 25 Nov 2010 22:14:18 +0000 (14:14 -0800)]
Pass STATIC_EXT to t/porting/FindExt.t

The list of static extensions on Windows is only known
inside win32/Makefile and win32/makefile.mk, so we need
to somehow pass it to t/porting/FindExt.t to give it
a chance to pass on Windows.

Unfortunately this means that PERL_STATIC_EXT will have
to be set manually if this test is to be run directly
and not via the Makefile.

11 years agoInclude ws2tcpip.h to get IPv6 definitions
Jan Dubois [Thu, 25 Nov 2010 20:23:05 +0000 (12:23 -0800)]
Include ws2tcpip.h to get IPv6 definitions

This commit also moves down the 'extern "C"' wrapper so that
it doesn't apply to any #included headers because they may
generate C++ code (templates) which doesn't confirm to "C"
linkage (when this header is included in C++ mode, e.g. while
compiling win32/perllib.c).

11 years ago[PATCH 5/5] Added Paul Evans to AUTHORS
Paul Evans [Thu, 25 Nov 2010 20:10:25 +0000 (20:10 +0000)]
[PATCH 5/5] Added Paul Evans to AUTHORS

Signed-off-by: Chris 'BinGOs' Williams <chris@bingosnet.co.uk>
11 years ago[PATCH 4/5] Adjust unit tests to cope with new sockaddr_in6 functions in Socket ...
Paul Evans [Thu, 25 Nov 2010 20:09:15 +0000 (20:09 +0000)]
[PATCH 4/5] Adjust unit tests to cope with new sockaddr_in6 functions in Socket (pulled in via IO::Socket)

Signed-off-by: Chris 'BinGOs' Williams <chris@bingosnet.co.uk>
11 years ago[PATCH 3/3] Provide wrappers for IN6ADDR_ANY and IN6ADDR_LOOPBACK
Paul Evans [Thu, 25 Nov 2010 20:08:05 +0000 (20:08 +0000)]
[PATCH 3/3] Provide wrappers for IN6ADDR_ANY and IN6ADDR_LOOPBACK

Signed-off-by: Chris 'BinGOs' Williams <chris@bingosnet.co.uk>
11 years ago[PATCH 2/3] Implement sockaddr_in6 wrapper
Paul Evans [Thu, 25 Nov 2010 20:07:23 +0000 (20:07 +0000)]
[PATCH 2/3] Implement sockaddr_in6 wrapper

Signed-off-by: Chris 'BinGOs' Williams <chris@bingosnet.co.uk>
11 years ago[PATCH 1/3] Implement Socket::pack_sockaddr_in6() and unpack_sockaddr_in6()
Paul Evans [Thu, 25 Nov 2010 20:06:36 +0000 (20:06 +0000)]
[PATCH 1/3] Implement Socket::pack_sockaddr_in6() and unpack_sockaddr_in6()

Signed-off-by: Chris 'BinGOs' Williams <chris@bingosnet.co.uk>
11 years ago[perl #78438] Memory leak with 'use v5.42'
Father Chrysostomos [Thu, 25 Nov 2010 14:14:40 +0000 (06:14 -0800)]
[perl #78438] Memory leak with 'use v5.42'

11 years agoStop eval "use 6" from leaking
Father Chrysostomos [Thu, 25 Nov 2010 14:11:12 +0000 (06:11 -0800)]
Stop eval "use 6" from leaking

11 years agoStop eval "no 5" from leaking
Father Chrysostomos [Thu, 25 Nov 2010 14:06:31 +0000 (06:06 -0800)]
Stop eval "no 5" from leaking

11 years agoMake BEGIN {require 5.12.0} behave as documented.
Nicholas Clark [Thu, 25 Nov 2010 17:08:18 +0000 (17:08 +0000)]
Make BEGIN {require 5.12.0} behave as documented.

Previously in a BEGIN block, require was behaving identically to use 5.12.0 -
ie erroneously executing the use feature ':5.12.0'; and use strict;
use warnings behaviour, which only use was documented to provide.

11 years agoExtend -d:foo=bar to make -d:-foo expand to C<no foo>, consistent with -M-foo
Nicholas Clark [Thu, 25 Nov 2010 14:58:42 +0000 (14:58 +0000)]
Extend -d:foo=bar to make -d:-foo expand to C<no foo>, consistent with -M-foo

11 years agoUse newSVpvs_flags() instead of sv_2mortal(newSVpvs())
Nicholas Clark [Thu, 25 Nov 2010 13:53:28 +0000 (13:53 +0000)]
Use newSVpvs_flags() instead of sv_2mortal(newSVpvs())

And similarly for newSVpvn() for a known length.

11 years agoUpdate MIME-Base64 to CPAN version 3.11
Chris 'BinGOs' Williams [Thu, 25 Nov 2010 12:48:21 +0000 (12:48 +0000)]
Update MIME-Base64 to CPAN version 3.11

  [DELTA]

  2010-10-24   Gisle Aas <gisle@ActiveState.com>

   Release 3.11

   Provide encode_base64url and decode_base64url functions to process
   the base64 scheme for "URL applications".

   The decode_base64() does not issue warnings on suspect input data
   any more.

11 years agoRefactor ENAME dumping in Perl_do_sv_dump() to simplify the code slightly.
Nicholas Clark [Thu, 25 Nov 2010 11:53:10 +0000 (11:53 +0000)]
Refactor ENAME dumping in Perl_do_sv_dump() to simplify the code slightly.

Simpler code avoids the need for a comment explaining how the complex code was
working. Also use newSVpvs_flags() in place of sv_newmortal() and sv_setpv().

11 years agoTest dumping stashes, with various combinations of NAME and ENAME.
Nicholas Clark [Thu, 25 Nov 2010 11:52:09 +0000 (11:52 +0000)]
Test dumping stashes, with various combinations of NAME and ENAME.

11 years agoRefactor Peek.t to give more useable diagnostics.
Nicholas Clark [Thu, 25 Nov 2010 10:24:22 +0000 (10:24 +0000)]
Refactor Peek.t to give more useable diagnostics.

Change the numeric test IDs to meaningful names. Provide the names as test
descriptions. Describe the purpose of the second test. Only output the line
numbers if the tests fail. Swap from an explicit plan to done_testing().

11 years agoIt's a little late to get changes into 5.12
Florian Ragwitz [Thu, 25 Nov 2010 03:09:23 +0000 (04:09 +0100)]
It's a little late to get changes into 5.12

11 years agoFix signature of sv_unmagic in perlguts.pod
Florian Ragwitz [Thu, 25 Nov 2010 01:43:27 +0000 (02:43 +0100)]
Fix signature of sv_unmagic in perlguts.pod

11 years agoExplicitly export Perl_sv_compile_2op_is_broken(), for ext/re.
Nicholas Clark [Wed, 24 Nov 2010 21:55:15 +0000 (21:55 +0000)]
Explicitly export Perl_sv_compile_2op_is_broken(), for ext/re.

Frustratingly, because regcomp.c is also compiled as ext/re/re_comp.c, anything
it needs has to be exported. So this has to be X. I'd rather it wasn't.

11 years agominor amendment to documentation of ?PATTERN?
David Golden [Wed, 24 Nov 2010 19:51:27 +0000 (14:51 -0500)]
minor amendment to documentation of ?PATTERN?

11 years agoDeprecate ?PATTERN? without explicit m operator
Zefram [Wed, 24 Nov 2010 19:32:50 +0000 (14:32 -0500)]
Deprecate ?PATTERN? without explicit m operator

Deprecate ?PATTERN?, recommending the equivalent m?PATTERN? syntax, in
order to eventually allow the question mark to be used in new operators
that would currently be ambiguous.

(With minor reconciliation edits by David Golden)

Signed-off-by: David Golden <dagolden@cpan.org>
11 years agoDeprecate sv_compile_2op()
Nicholas Clark [Wed, 24 Nov 2010 17:56:39 +0000 (17:56 +0000)]
Deprecate sv_compile_2op()

It attempted to provide an API to compile code down to an optree, but failed
to bind correctly to lexicals in the enclosing scope. It's not possible to
fix this problem within the constraints of its parameters and return value.

Searches suggest +that nothing on CPAN is using it, so removing it should have
zero impact.

11 years agoFix a typo introduced by 15d9236d3878cc50. (The wrong member of a union).
Nicholas Clark [Wed, 24 Nov 2010 17:53:32 +0000 (17:53 +0000)]
Fix a typo introduced by 15d9236d3878cc50. (The wrong member of a union).

This would have caused no functional changes, just compiler warnings.

11 years agoAdd fold_latin1 to the list of exported variable symbols (unbreaking Win32+gcc build)
Max Maischein [Wed, 24 Nov 2010 15:54:52 +0000 (16:54 +0100)]
Add fold_latin1 to the list of exported variable symbols (unbreaking Win32+gcc build)

11 years agoDon't use "try" as a variable name
Rafael Garcia-Suarez [Wed, 24 Nov 2010 13:43:30 +0000 (14:43 +0100)]
Don't use "try" as a variable name

"try" being a C++ keyword, this produces compilation warnings.

11 years agoRemove unused variable from S_set_regclass_bit_fold()
Nicholas Clark [Wed, 24 Nov 2010 11:59:50 +0000 (11:59 +0000)]
Remove unused variable from S_set_regclass_bit_fold()

11 years agoClarify m?PATTERN? is ok and only ?PATTERN? is not
David Golden [Wed, 24 Nov 2010 11:50:08 +0000 (06:50 -0500)]
Clarify m?PATTERN? is ok and only ?PATTERN? is not

11 years agoConvert xhv_name in struct xpvhv_aux to be a union of HEK* and HEK**
Nicholas Clark [Wed, 24 Nov 2010 11:36:36 +0000 (11:36 +0000)]
Convert xhv_name in struct xpvhv_aux to be a union of HEK* and HEK**

This avoids a lot of casting. Nothing outside the perl core code is accessing
that member directly.

11 years agoUpdate Unicode-Collate to CPAN version 0.68
Chris 'BinGOs' Williams [Tue, 23 Nov 2010 19:12:21 +0000 (19:12 +0000)]
Update Unicode-Collate to CPAN version 0.68

  [DELTA]

  0.68  Tue Nov 23 20:17:22 2010
    - doc: clarified about (backwards => [ ]) and (backwards => undef).
    - separated t/backwds.t from t/test.t.
    - added cjk_b5.t, cjk_gb.t, cjk_ja.t, cjk_ko.t, cjk_py.t, cjk_st.t in t
      for CJK/*.pm without Locale.pm.

11 years agoDocument the refcount of version functions’ retval
Father Chrysostomos [Tue, 23 Nov 2010 17:56:19 +0000 (09:56 -0800)]
Document the refcount of version functions’ retval