platform/upstream/perl.git
13 years agomktables: Include simple case foldings
Karl Williamson [Sun, 20 Mar 2011 01:11:16 +0000 (19:11 -0600)]
mktables: Include simple case foldings

F(ull) case foldings are not handled all that well in Perl.  It turns out
that a number of them have S foldings as well.  In all cases, what
matches in S is supposed to also match in F, but Perl doesn't always
know that; this adds that information.

13 years agoperlfunc: clarified 'do FILE' error checking
David Golden [Sun, 20 Mar 2011 01:55:15 +0000 (21:55 -0400)]
perlfunc: clarified 'do FILE' error checking

Partial fix for RT #80626

13 years agoperl5123delta: Improve description
Father Chrysostomos [Sun, 20 Mar 2011 01:52:35 +0000 (18:52 -0700)]
perl5123delta: Improve description

‘lvalue sub return values are now COW’ is not very clear.
I know 5.12.3 is already released, but at least for posterity’s
sake it’s nice to make this more descriptive.

13 years agoperl5122delta: typo
Father Chrysostomos [Sun, 20 Mar 2011 01:42:25 +0000 (18:42 -0700)]
perl5122delta: typo

13 years agoperl5122delta: Correct two references
Father Chrysostomos [Sun, 20 Mar 2011 00:50:31 +0000 (17:50 -0700)]
perl5122delta: Correct two references

These are CPAN tickets, not perl tickets.

13 years agoUpdated HTTP::Tiny to CPAN version 0.011
David Golden [Sun, 20 Mar 2011 00:51:48 +0000 (20:51 -0400)]
Updated HTTP::Tiny to CPAN version 0.011

[DELTA]

0.011     2011-03-19 20:48:39 America/New_York

  [BUG FIXES]

  - Made t/000_load.t less verbose under harness (RT#65507) [Dave Mitchell]

  - Removed 'Errno' as an explicit prefix (it is a core module, but not
    indexed by PAUSE, which might confuse some installers

13 years agoregcomp.c: RT#77414. Initialize flag
Karl Williamson [Sun, 20 Mar 2011 00:41:48 +0000 (18:41 -0600)]
regcomp.c: RT#77414. Initialize flag

As indicated in the comments, this flag needs to be initialized to
1 or the optimizer loses the fact that something could match a
character that isn't in utf8 and whose bitmap bit isn't set.  This
happens, for example, with Unicode properties.

Thus this fixes #77414.  That ticket had been closed recently because
it went away due to another patch that caused the optimizer to be
bypassed in the cases tested for.  But when that patch was reverted,
and cleaned-up, this bug came back.  Now, I believe I have found the
root cause.

13 years agoregcomp.c: /l uses the \w, etc. classes
Karl Williamson [Sun, 20 Mar 2011 00:37:53 +0000 (18:37 -0600)]
regcomp.c: /l uses the \w, etc. classes

For non-locale, \d, etc are compiled in with their actual code points they
match, so the class portion of the synthetic start class node is
irrelevant, and should initialized to zero to avoid confusion.  But for
locale it is highly relevant, and should be initialized to all ones, to
indicate matching anything.

13 years agoregcomp.c: Optimizer could lose some info
Karl Williamson [Sun, 20 Mar 2011 00:33:17 +0000 (18:33 -0600)]
regcomp.c: Optimizer could lose some info

When ORing two nodes together for the synthetic start class, and one
matches outside the 256-char bitmap, we currently don't know what it
matches.  In some cases it could be some or all of those 256 characters.
If so, we have to assume it's all of them.

13 years agoregcomp.c: Move statement down.
Karl Williamson [Sun, 20 Mar 2011 00:21:32 +0000 (18:21 -0600)]
regcomp.c: Move statement down.

This is in prep for another commit which needs the flags to be
untouched for some tests.

13 years agopat_advanced.t: Bump watchdog timeout
Karl Williamson [Sun, 20 Mar 2011 00:18:39 +0000 (18:18 -0600)]
pat_advanced.t: Bump watchdog timeout

When my system was at 100%, the 2 seconds wasn't enough.  I set it
to 10 seconds which is the most common value used in other .t's

13 years agoregcomp.h: Add ANYOF_CLASS_SETALL()
Karl Williamson [Sat, 19 Mar 2011 21:10:21 +0000 (15:10 -0600)]
regcomp.h: Add ANYOF_CLASS_SETALL()

This macro sets all the bits of the class (for \w, etc) for use during
initialization

13 years agoutf8.h: A fold buffer needs to hold any utf8 char
Karl Williamson [Sat, 19 Mar 2011 21:31:30 +0000 (15:31 -0600)]
utf8.h: A fold buffer needs to hold any utf8 char

It can't just be large enough to hold the Unicode subset.

13 years agoregexec.c: execute inappropriately skipped code
Karl Williamson [Sat, 19 Mar 2011 21:22:11 +0000 (15:22 -0600)]
regexec.c: execute inappropriately skipped code

The comment said that there was no use doing this in lenp was NULL,
but there is, as it sees if there is a match or not and sets the
appropriate variable.

13 years agoregexec.c: Chg var. name for clarity
Karl Williamson [Sat, 19 Mar 2011 21:19:00 +0000 (15:19 -0600)]
regexec.c: Chg var. name for clarity

13 years agoUpdate CPANPLUS to CPAN version 0.9103
Chris 'BinGOs' Williams [Sun, 20 Mar 2011 00:37:18 +0000 (00:37 +0000)]
Update CPANPLUS to CPAN version 0.9103

  [DELTA]

  Changes for 0.9103      Sun Mar 20 00:38:05 2011
  ================================================
  * Fixed the logic not sending NA reports when
    'perl' is expressed as a prereq

13 years agoMore version bumps in view of recent PERL_NO_GE_CONTEXT commits
Father Chrysostomos [Sun, 20 Mar 2011 00:39:14 +0000 (17:39 -0700)]
More version bumps in view of recent PERL_NO_GE_CONTEXT commits

13 years agoClean: Move old comment to proper location
Michael Witten [Sun, 20 Mar 2011 00:34:58 +0000 (17:34 -0700)]
Clean: Move old comment to proper location

This:

  commit 0298d7b92741692bcf2e34c418a564332bb034e6:
  Date:   Tue May 31 10:40:01 2005 +0000

      Avoid updating a variable in a loop.
      Only calculate the number of links in a hash bucket chain if we really
      need it.

      p4raw-id: //depot/perl@24648

forgot to move a large comment to its new location; this new commit
fixes that.

13 years agoDoc patch for perlsyn, clarification in given/when
Alastair Douglas [Sun, 20 Mar 2011 00:26:43 +0000 (17:26 -0700)]
Doc patch for perlsyn, clarification in given/when

I had about an hour of über confusion regarding smart matching in a
when, and when I finally clocked on to what the POD was telling me I
thought clarification would be in order. Many agreed :)

The chief change I would make is to use the word 'operands' instead of
'arguments' when referring to the ... and ..., ... && ... etc
sections; this was the major cause of my confusion. Second
clarification is that 'the test' in question is whether to use smart
matching, not the result of using smart matching!

Patch follows; please go ahead and amend as required :)

13 years agoAdd Alastair Douglas to AUTHORS
Father Chrysostomos [Sun, 20 Mar 2011 00:26:38 +0000 (17:26 -0700)]
Add Alastair Douglas to AUTHORS

13 years agoPerl_sighandler: only inc SS_ix for unsafe signals
David Mitchell [Sat, 19 Mar 2011 21:49:34 +0000 (21:49 +0000)]
Perl_sighandler: only inc SS_ix for unsafe signals

Perl_sighandler currently increments the savestack by 5
before running a signal handler, to avoid messing with a
partially completed SS push operation that's been interrupted.

This is irrelevant for safe signals, so make this action conditional on
unsafe signals only.

13 years agoIn signal handler, don't inc stack pointers
David Mitchell [Sat, 19 Mar 2011 21:29:16 +0000 (21:29 +0000)]
In signal handler, don't inc stack pointers

In Perl_sighandler, we currently increment PL_markstack_ptr and
PL_scopestack_ix.

This was added back in 1997 in the era of unsafe signals, to make them
slightly less unsafe. The idea presumably was to stop signal handlers
inadvertently corrupting the top element of each stack. However, given that
the normal method of pushing something onto those stacks is to increment
the pointer before pushing the value, I don't see how that can happen.

The downside of this is that an uninitialised or stale value can be left
in the 'hole' left on these stacks. When exiting from a signal handler via
exit(), these holes can be read and corruption occur, while stack
unwinding is taking place. The ordering of things means we can't use
SAVEDESTRUCTOR_X to undo the damage.

This commit leaves the 'PL_savestack_ix += 5', because in this case, with
unsafe signals, it *is* possible to interrupt halfway through a new set of
save data being pushed onto the stack, and it *is* possible for this to be
undone via SAVEDESTRUCTOR_X. (But it's still unsafe and half-baked.)

This fixes [perl #85206].

13 years agoAdd PERL_NO_GET_CONTEXT to NDBM_File
Nicholas Clark [Sat, 19 Mar 2011 21:20:46 +0000 (21:20 +0000)]
Add PERL_NO_GET_CONTEXT to NDBM_File

For threaded platforms, this reduces the object code size, and should slightly
reduce CPU usage.

13 years agoAdd PERL_NO_GET_CONTEXT to GDBM_File
Nicholas Clark [Sat, 19 Mar 2011 21:19:58 +0000 (21:19 +0000)]
Add PERL_NO_GET_CONTEXT to GDBM_File

For threaded platforms, this reduces the object code size, and should slightly
reduce CPU usage.

13 years agoVersion bumps for the recent PERL_NO_GET_CONTEXT commits
Father Chrysostomos [Sat, 19 Mar 2011 21:40:36 +0000 (14:40 -0700)]
Version bumps for the recent PERL_NO_GET_CONTEXT commits

13 years agoperl5121delta: #72998 was introduced earlier
Father Chrysostomos [Sat, 19 Mar 2011 19:02:14 +0000 (12:02 -0700)]
perl5121delta: #72998 was introduced earlier

13 years agoAdd PERL_NO_GET_CONTEXT to mro
Nicholas Clark [Sat, 19 Mar 2011 20:51:18 +0000 (20:51 +0000)]
Add PERL_NO_GET_CONTEXT to mro

For threaded platforms, this reduces the object code size, and should slightly
reduce CPU usage.

13 years agoAdd PERL_NO_GET_CONTEXT to attributes
Nicholas Clark [Sat, 19 Mar 2011 20:43:32 +0000 (20:43 +0000)]
Add PERL_NO_GET_CONTEXT to attributes

For threaded platforms, this reduces the object code size, and should slightly
reduce CPU usage.

13 years agoAdd PERL_NO_GET_CONTEXT to XS::Typemap
Nicholas Clark [Sat, 19 Mar 2011 20:36:38 +0000 (20:36 +0000)]
Add PERL_NO_GET_CONTEXT to XS::Typemap

For threaded platforms, this almost halves the object code size.

13 years agoAdd PERL_NO_GET_CONTEXT to Sys::Hostname
Nicholas Clark [Sat, 19 Mar 2011 20:28:55 +0000 (20:28 +0000)]
Add PERL_NO_GET_CONTEXT to Sys::Hostname

For threaded platforms, this reduces the object code size, and should slightly
reduce CPU usage.

13 years agoAdd PERL_NO_GET_CONTEXT to I18N::Langinfo
Nicholas Clark [Sat, 19 Mar 2011 20:22:08 +0000 (20:22 +0000)]
Add PERL_NO_GET_CONTEXT to I18N::Langinfo

For threaded platforms, this reduces the object code size, and should slightly
reduce CPU usage.

13 years agoAdd PERL_NO_GET_CONTEXT to Hash::Util
Nicholas Clark [Sat, 19 Mar 2011 20:15:19 +0000 (20:15 +0000)]
Add PERL_NO_GET_CONTEXT to Hash::Util

For threaded platforms, this reduces the object code size, and should slightly
reduce CPU usage.

13 years agoAdd PERL_NO_GET_CONTEXT to Hash::Util::FieldHash
Nicholas Clark [Sat, 19 Mar 2011 20:03:47 +0000 (20:03 +0000)]
Add PERL_NO_GET_CONTEXT to Hash::Util::FieldHash

For threaded platforms, this reduces the object code size, and should slight
reduce CPU usage.

13 years agoAdd PERL_NO_GET_CONTEXT to File::Glob
Nicholas Clark [Sat, 19 Mar 2011 19:40:20 +0000 (19:40 +0000)]
Add PERL_NO_GET_CONTEXT to File::Glob

For threaded platforms, this reduces the object code size, and should slightly
reduce CPU usage.

13 years agoAdd PERL_NO_GET_CONTEXT to dl_dlopen.xs
Nicholas Clark [Sat, 19 Mar 2011 19:10:42 +0000 (19:10 +0000)]
Add PERL_NO_GET_CONTEXT to dl_dlopen.xs

For threaded builds on platforms using dlopen() for dynamic loading, this
should reduce object size, and slightly reduce CPU usage when loading
extensions.

13 years agoStop hang in regex
Karl Williamson [Sat, 19 Mar 2011 20:50:46 +0000 (14:50 -0600)]
Stop hang in regex

The algorithm for mapping multi-char fold matches back to the source in
processing ANYOF nodes was defective.  This caused the regex engine to
hang on certain character combinations.  I've also added an assert to
stop instead of loop.

13 years agoreset pos and utf8 cache when de/encoding utf8 str
David Mitchell [Sat, 19 Mar 2011 19:26:49 +0000 (19:26 +0000)]
reset pos and utf8 cache when de/encoding utf8 str

When using
    utf8::upgrade
    utf8::downgrade
    utf8::encode
    utf8::decode
or the underlying C-level functions
    sv_utf8_upgrade_flags_grow
    sv_utf8_downgrade
    sv_utf8_encode
    sv_utf8_decode
and
    sv_recode_to_utf8

update the position of the pos magic, if any, and clear the utf8
length/position-mapping cache.

This fixes [perl #80190].

13 years agoFixup errno definitions for Windows
Jan Dubois [Sat, 19 Mar 2011 00:45:10 +0000 (17:45 -0700)]
Fixup errno definitions for Windows

Redefine all winsock based Exxxx error constants used in the
core: For VS2010 we don't want to use the errno.h values, and
for older compiler versions we don't have a definition anyways.

Also remove the warnings about VS2010 from README.win32, as
they should all be resolved now.

13 years agoRedefine errno values for Visual Studio 2010
Steve Hay [Sat, 19 Mar 2011 00:04:35 +0000 (17:04 -0700)]
Redefine errno values for Visual Studio 2010

Perl traditionally stores WinSock error codes (values above 10000) in
errno, with corresponding support for $! to stringify them properly.

In Visual Studio 2010 (and presumably newer Windows SDKs) Microsoft
has started to define additional errno constants in errno.h (values
between 100 and 200) with conflicting names (e.g. EWOULDBLOCK).

There are 2 ways to deal with this situation:

1) Redefine the errno.h constants back to the winsock values for
   the Errno and POSIX modules.

2) Translate the winsock error codes to the new errno constants
   in the socket implementation in win32/win32sck.c.

Solution 1) has the advantage that any existing Perl code that has
numeric error codes hard-coded in it will continue to work.

Solution 2) has the advantage that XS code using external libaries can
set errno to the new constants, and they will be handled consistently
in the Perl core.  It will however need additional support for other
compilers and runtime libraries that don't support these new error
codes.

This commit implements solution 1).

Blame attribution: the commit message is from Jan Dubois,
the actual patch was created by Steve Hay.

Signed-off-by: Jan Dubois <jand@activestate.com>
13 years ago[PATCH] [pod] improve documentation for (?(cond)yes|no)
Moritz Lenz [Sat, 19 Mar 2011 10:44:23 +0000 (10:44 +0000)]
[PATCH] [pod] improve documentation for (?(cond)yes|no)

perlre:    Include a high-level description of what it does, and what a missing
           pattern means
perlreref: Include missing look-around cases

Signed-off-by: Chris 'BinGOs' Williams <chris@bingosnet.co.uk>
13 years agoregcomp.c: Reorder if to silence valgrind
Karl Williamson [Fri, 18 Mar 2011 16:24:04 +0000 (10:24 -0600)]
regcomp.c: Reorder if to silence valgrind

It is better to test that a pointer is in bounds before dereferencing it
even though in this case it doesn't lead to an actual error.

13 years agoregex: Fix locale regression
Karl Williamson [Fri, 18 Mar 2011 14:36:17 +0000 (08:36 -0600)]
regex: Fix locale regression

Things like \S have not been accessible to the synthetic start class
under locale matching rules.  They have been placed there, but the
start class didn't know they were there.

This patch sets ANYOF_CLASS in initializing the synthetic start class
so that downstream code knows it is a charclass_class, and removes
the code that partially allowed this bit to be shared, and which isn't
needed in 5.14, and more thought would have to go into doing it than
was reflected in the code.

I can't come up with a test case that would verify that this works,
because of general locale testing issues, except it looked at a dump of
the generated regex synthetic start class, but the dump isn't the same
thing as the real behavior, and using one is also subject to breakage if
the regex code changes in the slightest.

13 years agocharset.t: Skip locale tests depending on platform
Karl Williamson [Thu, 17 Mar 2011 19:55:35 +0000 (13:55 -0600)]
charset.t: Skip locale tests depending on platform

The locale tests in this file assume that the code points 128-255 are
not printable, etc in the C locale.  Some platforms do not conform to that
so test at the beginning for that.

13 years agoAdd perldelta entry about improved kill(9,$pid) on Windows
Jan Dubois [Thu, 17 Mar 2011 17:38:18 +0000 (10:38 -0700)]
Add perldelta entry about improved kill(9,$pid) on Windows

I'm only adding it because there was a comment at the top of
perldelta that this change was missing an entry.  I'm not
sure it has to be mentioned at all, as it is not a full fix,
just making the issue less likely to occur.

13 years ago#81026: Perl binary no longer relocatable
Jan Dubois [Thu, 17 Mar 2011 17:14:19 +0000 (10:14 -0700)]
#81026: Perl binary no longer relocatable

Provide a preprocessor macro PERL_RELOCATABLE_INCPUSH to tell
incpush_use_sep() to ignore the passed in len argument.  This
enables relocatable Perl distributions that patch the various
paths at install time.

Core Perl neither provides actual relocation scripts/programs,
nor endorses this practise as being "supported"; this patch
only makes it possible to create such tools.  It is therefore
undocumented outside the source level comments.

13 years agoregcomp.c: Avoid locale in optimizer unless necessary
Karl Williamson [Thu, 17 Mar 2011 16:24:28 +0000 (10:24 -0600)]
regcomp.c: Avoid locale in optimizer unless necessary

This is further work along the lines in RT #85964 and commit
af302e7fa58415c2d8454c8cbef7bccd8b504257.  It reverts, for the the most
part, commits aa19b56b2f07e9eabf57540f00d312d8093e9d28 (Remove unused
parameter) and c613755a4b4fc8e64a77639d47d7e208fee68edc (/l in synthetic
start class).

Those commits caused the synthetic start class to often be marked as
matching under locale rules, even if there was no part of the regular
expression that used locale.  This led to RT #85964, which made apparent
that there were a number of assumptions in the optimizer about locale
that were no longer necessarily true.  This new commit changes things so
that locale has to be somewhere in the regex in order to get the
synthetic start class to include /l.  In other words, this reverts the
effect of those commits to regular expression which have /l -- we go
back to the old way of doing things for non-locale regexes.  This limits
any bugs that may have been introduced by the addition of /l (and being
able to match only sub-parts of a regex under locale) to the relatively
uncommon regexes which actually use it.  There are a number of bugs
that have surfaced for the locale rules regexes that have gone
unreported; and some say locale rules regexes should be deprecated.

13 years agoRevert "re/pat.t: Remove TODO message on passing tests"
Karl Williamson [Thu, 17 Mar 2011 16:14:58 +0000 (10:14 -0600)]
Revert "re/pat.t: Remove TODO message on passing tests"

This reverts commit b8953805dfeee53cd2300f61834ba32ccaaefaa8.
These tests started passing as a side effect of a commit which now needs
to be reverted for other reasons.

13 years agoRevert "regcomp.c: Rmv unused parameter"
Karl Williamson [Thu, 17 Mar 2011 15:45:38 +0000 (09:45 -0600)]
Revert "regcomp.c: Rmv unused parameter"

This reverts commit c45df5a16bb5a26a06275cc63f2c3e6b1d708184.
The parameter is about to be put back in.

13 years agoregcomp.c: Add flag for /l occurring anywhere
Karl Williamson [Thu, 17 Mar 2011 15:40:13 +0000 (09:40 -0600)]
regcomp.c: Add flag for /l occurring anywhere

If any part of a pattern has /l, this flag will get set; for future
use.

13 years agoregcomp.c: Move comment
Karl Williamson [Thu, 17 Mar 2011 14:24:51 +0000 (08:24 -0600)]
regcomp.c: Move comment

13 years agoperldelta for 007f907
Father Chrysostomos [Thu, 17 Mar 2011 13:03:59 +0000 (06:03 -0700)]
perldelta for 007f907

13 years ago[perl #86328] coredump in cleaning up circular magic
Father Chrysostomos [Thu, 17 Mar 2011 12:46:25 +0000 (05:46 -0700)]
[perl #86328] coredump in cleaning up circular magic

The following program dumps core:
=============================================
#!/usr/bin/perl
use Scalar::Util qw(weaken);

sub TIEHASH {
    return bless [];
}

sub DESTROY {
    my ($tied) = @_;
    my $b = $tied->[0];
}

my $a = {};
tie %$a, "main";
weaken((tied %$a)->[0] = $a);

# Done setting up the evil data structure

$a = undef;
=============================================

The problem here, as Ton Hospel correctly observed in the ticket, is
that the DESTROY method called when tie magic is freed sees the weak
reference still in existence pointing to an SV with a refcount of 0.

This worked in 5.8.x, because the back-references were killed
before the tie magic was freed. It was a matter of what order the
magic is stored, as demonstrated by this script, which crashes in
5.8.x as well:

=============================================
#!/usr/bin/perl
use Scalar::Util qw(weaken);

sub TIEHASH {
    return $_[1];
}

sub DESTROY {
    my ($tied) = @_;
    my $b = $tied->[0];
}

my $a = {};
my $o = bless [];
weaken($o->[0] = $a);
tie %$a, "main", $o;

# Done setting up the evil data structure

$a = undef;
=============================================

In 5.10.0, with commit 86f5593, HVs stopped storing their back-refer-
ences in magic most of the time, and sv_clear started killing those
HV back-references after freeing magic; hence the change in order.

This commit solves the problem simply by freeing back-references
before magic. To take non-hash SVs (and undeffed hashes) into account,
it also frees backref magic before any other kind.

(This commit message started off as my own notes. But then it turned
into a history lesson. :-)

13 years agoregcomp.c: Omitted hard-coded case mapping
Karl Williamson [Thu, 17 Mar 2011 03:40:03 +0000 (21:40 -0600)]
regcomp.c: Omitted hard-coded case mapping

The code has hard-coded the possible case mappings for the code points
< 256.  This one was omitted.

13 years agoregcomp.c: Restore ptr correctly
Karl Williamson [Thu, 17 Mar 2011 03:38:02 +0000 (21:38 -0600)]
regcomp.c: Restore ptr correctly

oldp contains the pointer that we want to get to.  Use that instead
of a possibly invalid assumption about length

13 years agoregcomp.c: comment and white-space-only change
Karl Williamson [Thu, 17 Mar 2011 02:36:23 +0000 (20:36 -0600)]
regcomp.c: comment and white-space-only change

13 years agoRT #85964: bleadperl breaks CGI-FormBuilder
Karl Williamson [Wed, 16 Mar 2011 18:19:42 +0000 (12:19 -0600)]
RT #85964: bleadperl breaks CGI-FormBuilder

The introduction of the l regex modifier introduces the possibility that
a regular expression can have subportions that match under locale and
other portions that don't.   I (khw) failed to see all the implications
of that in the optimizer.  Unfortunately, things didn't start surfacing
until late in the development cycle.

The optimizer is structured so that a new blank node is initialized to
match anything, and the state is set to AND, so that the first real node
that comes along is supposed to be ANDed together; with the result being
that node.  (Like an AND of all 1's with some bit pattern yields that
bit pattern.)  Then the mode is switched to OR, so subsequent nodes that
could be the start ones are or'd in. *(see footnote below).
This design leads to some issues, like at the XXX line added by this
commit, which looks to be a work-around for the deficiencies of the
design.

Commit cf34198ebe3dd876d67c10caa9acf491ad2a0c51 that led to this ticket
changed things to include LOCALE as part of the initialization, so that
the l could be on and off in various parts of the regex.  I tried to
just revert that (plus associated parameter changes), and found that the
changes made to the AND and OR logic that fixed other problems really
depended on that commit.  Perhaps those could be worked around, but it
is not the forward direction.

This commit works around things in a different way.  What happened in
the earlier commit was that the synthetic start class (SSC) is, under
some circumstances, getting generated as matching locale even if there
is no locale matching in the regex.  (This could not happen if the
design were as described in the footnote.)  This shouldn't matter except
for potentially performance issues, as this would just be false
positives.  However, it turns out there is code in the optimizer that
assumes that locale and non-locale are never mixed; and so does not do
the right thing.

This patch is aimed at safety.  If the SSC is marked as locale, it sets
the bits for things like \w as if the SSC could also end up being for
non-locale.  This can generate false positives for true locale matches
but shouldn't introduce actual optimizer errors, since it only adds to
what the SSC can match and doesn't make any restrictions.

* I don't see why this design; it seems to me easier to start with the
initial state set to all 0's, and then the first node gets OR'd in,
yielding exactly that first node; then you don't have to switch;  you
still have to deal with AND cases, as for example in 0 length
lookaheads, but things are made easier.

13 years agoregcomp.c: white space only
Karl Williamson [Wed, 16 Mar 2011 17:58:04 +0000 (11:58 -0600)]
regcomp.c: white space only

13 years agoregcomp.c: \D and \d should work under locale
Karl Williamson [Wed, 16 Mar 2011 17:49:48 +0000 (11:49 -0600)]
regcomp.c: \D and \d should work under locale

A number of earlier commits have fixed various places where the code
assumed that digits did not move under locale.  This adds another two,
bringing the code here in line with the other sequences like \w

13 years agoregcomp.c: no bitmap means no bitmap
Karl Williamson [Wed, 16 Mar 2011 16:32:39 +0000 (10:32 -0600)]
regcomp.c: no bitmap means no bitmap

The line before this line indicates that there is no bitmap, but it
didn't clear this flag that says that there may be.  This was likely
a contributory bug to what ac51e94be5daabecdeb0ed734f3ccc059b7b77e3
tried to fix, and was eventually fixed in
6f8d7d0df3e3141d61246e6b0a3db12ab1fd7f92.

13 years agoregcomp.c: Add comment
Karl Williamson [Wed, 16 Mar 2011 16:31:08 +0000 (10:31 -0600)]
regcomp.c: Add comment

13 years agoRead Perl code on Windows in text mode by default.
Jan Dubois [Thu, 17 Mar 2011 00:45:29 +0000 (17:45 -0700)]
Read Perl code on Windows in text mode by default.

We used to read Perl code in binary mode to make life easier for
ByteLoder to include binary data in a source file.  To maintain the
illusion of text mode for the DATA handle the filehandle was
transformed from binary mode to text mode when the parser reached the
__END__ or __DATA__ tokens.

This however never worked correctly, as the positions returned by
tell(DATA) were still based on reading part of the stream in binary
mode.  And even worse, flushing all filehandles before calling
system(), backticks, or fork() would actually reposition the DATA
filehandle incorrectly, so future reads from it returned the wrong
data.

http://rt.perl.org/rt3/Ticket/Display.html?id=28106 contains several
bug reports that are all related to this problem.  The new t/io/data.t
file contains the failing code samples from those bugs.

This patch changes the default build option for Windows to text mode.
ByteLoader will have to deal with this internally, e.g. by rewinding
DATA and switching to binary mode itself.

13 years agoAdd TODO tests for #85964
Karl Williamson [Wed, 16 Mar 2011 16:23:41 +0000 (10:23 -0600)]
Add TODO tests for #85964

13 years agot/op/eval.t tweak for VMS due to record-oriented pipes.
Craig A. Berry [Wed, 16 Mar 2011 02:46:05 +0000 (21:46 -0500)]
t/op/eval.t tweak for VMS due to record-oriented pipes.

Broken in 0d804ff61f3a2df265fee122d53e0463dac6f878.

13 years agoRestore ada6eeb82df60fbe63c781f1a102393fd56d104b.
Craig A. Berry [Wed, 16 Mar 2011 02:41:25 +0000 (21:41 -0500)]
Restore ada6eeb82df60fbe63c781f1a102393fd56d104b.

which was clobbered by 149d510d6e1a1cffb86aac23789fcb26ff67ffa9,
and is still awaiting upstream integration at:

https://rt.cpan.org/Ticket/Display.html?id=64353

13 years agoSwitch t/lib/no_load.t to done_testing() from using an explicit plan.
Nicholas Clark [Wed, 16 Mar 2011 08:57:54 +0000 (08:57 +0000)]
Switch t/lib/no_load.t to done_testing() from using an explicit plan.

Using done_testing() means that it doesn't have to parse the test data
structure twice - firstly to calculate the number of tests, secondly to
actually run them.

13 years agoConvert the remainder of t/op/closure.t to test.pl
Nicholas Clark [Tue, 15 Mar 2011 20:45:40 +0000 (20:45 +0000)]
Convert the remainder of t/op/closure.t to test.pl

13 years agoConvert the middle test loops of closure.t to test.pl
Nicholas Clark [Tue, 15 Mar 2011 20:06:34 +0000 (20:06 +0000)]
Convert the middle test loops of closure.t to test.pl

The nested loops build tap-generating test programs, spawn them, capture their
output, directly print the output, and also run a rudimentary pass of it to
look for /not ok/, or anything on STDERR. Retain the same structure, and retain
the existing spawning code which (a) works and (b) has comments about being
careful to avoid problems with redirection and inherited STD*, but switch to
using test.pl in the test programs, giving each test an identifying
description, and better diagnostics if anything fails.

13 years agoConvert the last third of t/op/closure.t to test.pl
Nicholas Clark [Tue, 15 Mar 2011 17:23:53 +0000 (17:23 +0000)]
Convert the last third of t/op/closure.t to test.pl

closure.t's test function has a prototype of &, so all the blocks passed to it
may well be closures themselves, albeit simple ones over the outer lexicals of
the test script. However all of the tests are explicitly testing other
closures, systematically building up from these most simple behaviours, so
this is a side effect of the implementation, and removing it is not going to
leave particular behaviours untested. It may actually make the test more
robust, as particular closure bugs accidentally introduced will only cause
their tests to fail, instead of having the side effect of causing seemingly
unrelated tests to fail too.

13 years agoHang on to child handle after signalling SIGTERM
Jan Dubois [Tue, 15 Mar 2011 23:53:00 +0000 (16:53 -0700)]
Hang on to child handle after signalling SIGTERM

This is a refinement of commit 3aa0ac5aa.  We still want to hang on
to the mapping between pseudo-process and thread handle, so that we
can still waitpid() after signalling SIGTERM. We just don't want to
wait implicitly on the signalled process anymore.

13 years agoDon't wait for SIGTERM'ed forked children on Windows
Jan Dubois [Tue, 15 Mar 2011 19:34:10 +0000 (12:34 -0700)]
Don't wait for SIGTERM'ed forked children on Windows

SIGTERM may never get delivered when a thread/process is blocked in a
system call.  To avoid a deadlock Perl will now no longer wait for
children to terminate after they have been signalled with SIGTERM.

Note: this *only* applies to fork() emulation on Windows.  Read
pod/perlfork.pod for context on other limitation of this emulation.

13 years agoUpdate Pod-Simple to CPAN version 3.16
Chris 'BinGOs' Williams [Tue, 15 Mar 2011 16:47:47 +0000 (16:47 +0000)]
Update Pod-Simple to CPAN version 3.16

  [DELTA]

  2011-03-14   David E. Wheeler <david@justatheory.org>
        * Release 3.16

        Fixed invalid HTML generated for nested lists by Pod::Simple::XHTML
        (Fitz Elliott).

        Replaced the invalid "<nobr>" tag -- created for "S<>" -- with
        '<span style="white-space: nowrap;">' (Fitz Elliott).

        Fixed some nerbles in our own Pod (Michael Stevens)

        Improved the "Minimal code" example in Pod::Simple::HTML. The key
        is to use pase_file(), not parse_from_file() (which should
        otherwise be undocumented, and is just there for Pod::Parser
        compatibility. Thanks to prodding from Ævar Arnfjörð Bjarmason (RT
        #65428).

        Added the html_charset() and html_encode_chars() attributes to
        Pod::Simple::XHTML. Inspired by a bug report from Agent Zhang
        (章亦春) (RT #29587).

        Added "Minimal code" example to the Pod::Simple::XHTML documentation.

        Fixed mispelling of the "=encoding" markup in the parser (it was
        spelled "=encode"). Thanks to "TTY" for the patch. (RT #24820).

13 years agoConvert t/op/oct.t's main tests to data structure and loops.
Nicholas Clark [Tue, 15 Mar 2011 15:14:28 +0000 (15:14 +0000)]
Convert t/op/oct.t's main tests to data structure and loops.

This will make it easier to test that expected warnings are generated. However,
parts of the existing perl code would generate warnings if warnings were
enabled, as it seems that the source code literals used are also intended as
tests for edge cases in the parser.

13 years agoConvert t/op/oct.t to using test.pl for comparisons and diagnostics.
Nicholas Clark [Tue, 15 Mar 2011 14:23:16 +0000 (14:23 +0000)]
Convert t/op/oct.t to using test.pl for comparisons and diagnostics.

This eliminates the hard-coded test numbers, which will allow the tests to
be re-ordered.

13 years agoDon't set $ENV{PERL5LIB} in t/op/{anonsub,fork}.t as it isn't needed.
Nicholas Clark [Sun, 13 Mar 2011 21:45:16 +0000 (21:45 +0000)]
Don't set $ENV{PERL5LIB} in t/op/{anonsub,fork}.t as it isn't needed.

13 years agoBring the joy of strict (and warnings) to t/op/method.t
Nicholas Clark [Mon, 14 Mar 2011 20:02:36 +0000 (20:02 +0000)]
Bring the joy of strict (and warnings) to t/op/method.t

13 years agoperldelta up to b38b314
Father Chrysostomos [Mon, 14 Mar 2011 19:46:56 +0000 (12:46 -0700)]
perldelta up to b38b314

13 years agoConvert the remainder of t/op/eval.t to test.pl
Nicholas Clark [Mon, 14 Mar 2011 19:05:40 +0000 (19:05 +0000)]
Convert the remainder of t/op/eval.t to test.pl

In places this involves decoupling the control flow from the output of test
diagnostics to STDOUT. It reduces the line count by 25%, and should give
better diagnostics on failure.

13 years agoIn t/op/eval.t, move logic from a spawned program into the main test script.
Nicholas Clark [Mon, 14 Mar 2011 15:07:12 +0000 (15:07 +0000)]
In t/op/eval.t, move logic from a spawned program into the main test script.

This also allows a chunk of it to be removed. There's no need inside a spawned
script to

a: dup STDERR so that it can be restored
b: open STDERR to a temporary file
c: call Devel::Peek::Dump
d: close the temporary file
e: restore STDERR
f: open it for reading
g: manipulate the contents
h: return ok/not ot

when instead we can run step 'c' only, with STDERR captured, perform step 'g'
only in the main script, and finish with an is() test instead of an ok()
This also saves having to substitute a generated temporary filename into the
code for the spawned script.

[Collateral "damage" is converting the next test to use test.pl's is()]

13 years agoutf8_heavy.pl: Use CORE:: case function overridden
Karl Williamson [Mon, 14 Mar 2011 16:25:09 +0000 (10:25 -0600)]
utf8_heavy.pl: Use CORE:: case function overridden

Because an overridden case changing function may end up calling this
routine, it's better to use the CORE:: to avoid a recursive call

13 years agoResolved RT #59511 for Module::CoreList
Chris 'BinGOs' Williams [Mon, 14 Mar 2011 16:57:16 +0000 (16:57 +0000)]
Resolved RT #59511 for Module::CoreList

  Silenced the 'Can't call method "isa" without a package or object reference'
  warnings for the functions.

13 years ago[perl #82250] fix tainted (s)print format
David Mitchell [Mon, 14 Mar 2011 16:04:59 +0000 (16:04 +0000)]
[perl #82250] fix tainted (s)print format

commit 20ee07fbbcfa6be9f90bb8e5474a4d69d7396617
introduced dieing in (s)printf when the format is tainted;
however it only worked when the format is part of an expression
(because TAINT_PROPER checks for PL_tainted being set).

Fix by doing TAINT_PROPER only after get magic has been done on the format
SV (which will set PL_tainted). This is done by moving the checks in
pp_sprintf and pp_prtf into do_sprintf() (which is called by the two pp
functions).

13 years agoregcomp.c: utf8 pattern implies uni rules
Karl Williamson [Mon, 14 Mar 2011 15:18:28 +0000 (09:18 -0600)]
regcomp.c: utf8 pattern implies uni rules

This fixes a regression introduced with charset regex modifiers.  A utf8
pattern without a charset is supposed to mean unicode semantics.  But
it didn't until this patch.

13 years agoConvert t/re/regexp_unicode_prop.t to using test.pl's functions for testing.
Nicholas Clark [Mon, 14 Mar 2011 11:29:19 +0000 (11:29 +0000)]
Convert t/re/regexp_unicode_prop.t to using test.pl's functions for testing.

13 years agoConvert the remainder of t/op/numconvert.t to test.pl, strict and warnings.
Nicholas Clark [Mon, 14 Mar 2011 11:03:55 +0000 (11:03 +0000)]
Convert the remainder of t/op/numconvert.t to test.pl, strict and warnings.

13 years agoConvert t/re/subst_amp.t to test.pl, strict and warnings.
Nicholas Clark [Mon, 14 Mar 2011 09:00:44 +0000 (09:00 +0000)]
Convert t/re/subst_amp.t to test.pl, strict and warnings.

This reduces the line count by about 25%.
Also, remove the unneeded code to load Config, which is never referenced.

13 years agoAdd a test to ensure that test.pl doesn't mention $&
Nicholas Clark [Sun, 13 Mar 2011 17:58:29 +0000 (17:58 +0000)]
Add a test to ensure that test.pl doesn't mention $&

This will allow it to be used safely for tests that explicitly want to test the
behaviour of perl without (and with) $& having been seen by the parser.

13 years agoperlop: Mention the s///le special case
Father Chrysostomos [Mon, 14 Mar 2011 05:28:46 +0000 (22:28 -0700)]
perlop: Mention the s///le special case

This is apparently undocumented except in perldiag and a previous
perldelta.

13 years agoUpdate CPAN.pm to CPAN version 1.9600
David Golden [Mon, 14 Mar 2011 00:53:57 +0000 (20:53 -0400)]
Update CPAN.pm to CPAN version 1.9600

Only blead-visible change from 1.94_65 are version numbers and
the addition of the 2011 PAUSE batch signing key.

13 years agoperldelta up to d24f2be2
Father Chrysostomos [Mon, 14 Mar 2011 00:26:27 +0000 (17:26 -0700)]
perldelta up to d24f2be2

13 years agoRefactor t/op/assignwarn.t to generate all the tested code from data structures
Nicholas Clark [Sun, 13 Mar 2011 23:18:58 +0000 (23:18 +0000)]
Refactor t/op/assignwarn.t to generate all the tested code from data structures

13 years agoConvert t/op/anonsub.t to test.pl, strict and warnings.
Nicholas Clark [Sun, 13 Mar 2011 21:33:25 +0000 (21:33 +0000)]
Convert t/op/anonsub.t to test.pl, strict and warnings.

test.pl no longer uses closures, which removes the principal reason for
avoiding it until now. anonsub.t is now 25% shorter.

13 years agoIn test.pl, avoid using a closure to capture warnings.
Nicholas Clark [Sun, 13 Mar 2011 21:30:55 +0000 (21:30 +0000)]
In test.pl, avoid using a closure to capture warnings.

In the general case a closure is the "right" way to do "it". However, closures,
unlike local and regular subroutines, have some complexity at compile time,
which means that using closures in test.pl runs the risk of closure bugs
causing spurious hard to diagnose collateral damage to other tests. local is
already in use, and "has" to work for capturing warnings, as $SIG{__WARN__} is
localised already.

13 years agoConvert t/re/reg_mesg.t to test.pl and strict.
Nicholas Clark [Sun, 13 Mar 2011 19:08:57 +0000 (19:08 +0000)]
Convert t/re/reg_mesg.t to test.pl and strict.

This reduces its line count by 25%, with no loss of functionality.
(It actually tests slightly more, specifically that the regexps in @death don't
generate warnings, just die.)

13 years agoMove t/re/reg_unsafe.t's test to a fresh_perl_is() inside pat_advanced.t
Nicholas Clark [Sun, 13 Mar 2011 16:42:50 +0000 (16:42 +0000)]
Move t/re/reg_unsafe.t's test to a fresh_perl_is() inside pat_advanced.t

Add a passing variant which mentions $&. Note the bug number (#86042) in the
TODO test.

13 years agoConvert t/re/reg_email.t to test.pl, strict and warnings.
Nicholas Clark [Sun, 13 Mar 2011 15:49:50 +0000 (15:49 +0000)]
Convert t/re/reg_email.t to test.pl, strict and warnings.

13 years agoIn overload.t, move require './test.pl' into BEGIN to avoid stubbing subs.
Nicholas Clark [Sun, 13 Mar 2011 15:20:07 +0000 (15:20 +0000)]
In overload.t, move require './test.pl' into BEGIN to avoid stubbing subs.

Also move the use of strict and warnings after the BEGIN block, so that they
can take advantage of the @INC setting it performs. Swap to done_testing().

13 years agoConvert t/op/magic.t to test.pl, strict and warnings.
Nicholas Clark [Sun, 13 Mar 2011 15:16:15 +0000 (15:16 +0000)]
Convert t/op/magic.t to test.pl, strict and warnings.

Use ok() rather than the more "obvious" is(), cmp_ok() etc to strictly control
the number of accesses made to the passed in value. For example, is() accesses
its $got more than once, which defeats the purpose of this test.

13 years agoConvert t/op/die_unwind.t to test.pl, strict and warnings.
Nicholas Clark [Sun, 13 Mar 2011 15:04:42 +0000 (15:04 +0000)]
Convert t/op/die_unwind.t to test.pl, strict and warnings.

13 years agoConvert t/op/die_except.t to test.pl, strict and warnings.
Nicholas Clark [Sun, 13 Mar 2011 14:44:47 +0000 (14:44 +0000)]
Convert t/op/die_except.t to test.pl, strict and warnings.

13 years agoRemove the couple of references to AutoLoader that remained in
David Leadbeater [Sun, 13 Mar 2011 13:26:18 +0000 (14:26 +0100)]
Remove the couple of references to AutoLoader that remained in
DynaLoader after 0a0b6c96e6.