platform/upstream/perl.git
12 years agoregmatch(): remove reginput from CURLY etc
David Mitchell [Thu, 13 Sep 2012 18:58:25 +0000 (19:58 +0100)]
regmatch(): remove reginput from CURLY etc

reginput mostly tracked locinput, except when regrepeat() was called.
With a bit of jiggling, it could be eliminated for these blocks of code.

This is part of a campaign to eliminate the reginput variable.

12 years agoregmatch(): remove reginput from CURLYM
David Mitchell [Thu, 13 Sep 2012 10:38:26 +0000 (11:38 +0100)]
regmatch(): remove reginput from CURLYM

reginput, locinput and st->locinput were being used in a little
ballet to determine the length of the first match.
This is now simply locinput - st->locinput, or its unicode equivalent;
so the code can be simplified.

Elsewhere in the block: where reginput was being used, locinput and/or
nextchr already contain the same info, so use them instead.

This is part of a campaign to eliminate the reginput variable.

12 years agoregmatch(): remove reginput from IFMATCH etc
David Mitchell [Thu, 13 Sep 2012 10:12:40 +0000 (11:12 +0100)]
regmatch(): remove reginput from IFMATCH etc

It was being used essentially as a temporary var within the branch,
so replace it with a temp var in a new block scope.

On return in IFMATCH_A / IFMATCH_A_fail, there's no need to set reginput
any more, so don't. The SUSPEND case used to set locinput = reginput, but
at that point, the two variables already always had the same value anyway.

This is part of a campaign to eliminate the reginput variable.

12 years agoregmatch(): remove reginput from TRIE_next_fail:
David Mitchell [Thu, 13 Sep 2012 09:28:11 +0000 (10:28 +0100)]
regmatch(): remove reginput from TRIE_next_fail:

It was being used essentially as a temporary var within the branch,
so replace it with a temp var in a new block scope.

This is part of a campaign to eliminate the reginput variable.

12 years agoregmatch(): make PUSH_STATE_GOTO dest explicit
David Mitchell [Thu, 13 Sep 2012 08:22:38 +0000 (09:22 +0100)]
regmatch(): make PUSH_STATE_GOTO dest explicit

Currently, the string position from where matching continues after a PUSH
is implicitly specified by the value of reginput, which is usually just
equal to locinput. Make this explicit by adding an extra argument to
PUSH_STATE_GOTO() etc.

This is part of a campaign to eliminate the reginput variable.

12 years agoeliminate PL_reginput
David Mitchell [Wed, 12 Sep 2012 19:10:44 +0000 (20:10 +0100)]
eliminate PL_reginput

PL_reginput (which is actually #defined to PL_reg_state.re_state_reginput)
is, to all intents and purposes, state that is only used within
S_regmatch().

The only other places it is referenced are in S_regtry() and S_regrepeat(),
where it is used to pass the current match position back and forth between
the subs.

Do this passing instead via function args, and bingo! PL_reginput is now
just a local var of S_regmatch().

12 years agoFix compilation for -DPERL_POISON and -DPERL_OLD_COPY_ON_WRITE together.
Nicholas Clark [Thu, 13 Sep 2012 20:22:29 +0000 (22:22 +0200)]
Fix compilation for -DPERL_POISON and -DPERL_OLD_COPY_ON_WRITE together.

These have been present since PERL_POISON was added in June 2005 by commit
94010e71b67db040. It seems that no-one has tried compiling with both defined
together.

12 years agoFix buggy -DPERL_POISON code in S_rxres_free(), exposed by a recent test.
Nicholas Clark [Thu, 13 Sep 2012 16:13:43 +0000 (18:13 +0200)]
Fix buggy -DPERL_POISON code in S_rxres_free(), exposed by a recent test.

The code had been buggily attempting to overwrite just-freed memory since
PERL_POISON was added by commit 94010e71b67db040 in June 2005. However, no
regression test exercised this code path until recently.

Also fix the offset in the array of UVs used by PERL_OLD_COPY_ON_WRITE to
store RX_SAVED_COPY(). It now uses p[2]. Previously it had used p[1],
directly conflicting with the use of p[1] to store RX_NPARENS().

The code is too intertwined to meaningfully do these as separate commits.

12 years agoRestore the build under -DPERL_OLD_COPY_ON_WRITE
Nicholas Clark [Thu, 13 Sep 2012 15:05:58 +0000 (17:05 +0200)]
Restore the build under -DPERL_OLD_COPY_ON_WRITE

This was broken as a side effect of commit 6502e08109cd003b, recently merged
to blead.

12 years agoRefactor t/op/push.t to use test.pl instead of making TAP by hand.
Colin Kuskie [Fri, 14 Sep 2012 02:25:24 +0000 (19:25 -0700)]
Refactor t/op/push.t to use test.pl instead of making TAP by hand.

12 years agoRefactor t/run/switch0.t to use test.pl instead of making TAP by hand.
Colin Kuskie [Fri, 14 Sep 2012 02:06:02 +0000 (19:06 -0700)]
Refactor t/run/switch0.t to use test.pl instead of making TAP by hand.

12 years agoRefactor t/op/overload_integer.t to use test.pl instead of making TAP by hand.
Colin Kuskie [Fri, 14 Sep 2012 01:54:13 +0000 (18:54 -0700)]
Refactor t/op/overload_integer.t to use test.pl instead of making TAP by hand.

With minor change from committer: Always assign $@ asap after an eval.

12 years agoRefactor t/op/exists_sub.t to use test.pl instead of making TAP by hand.
Colin Kuskie [Fri, 14 Sep 2012 01:42:37 +0000 (18:42 -0700)]
Refactor t/op/exists_sub.t to use test.pl instead of making TAP by hand.

12 years agoMerge branch for mostly regen/regcharclass.pl into blead
Karl Williamson [Fri, 14 Sep 2012 03:14:54 +0000 (21:14 -0600)]
Merge branch for mostly regen/regcharclass.pl into blead

I started this work planning to enhance regen/regcharclass.pl to accept
Unicode properties as input so that some small properties used in \X
could be compiled in, instead of having to be read from disk.  In doing
so, I saw some opportunities to move some EBCDIC dependencies down to a
more basic level, thus replacing quite a few existing ones with just a
couple at the lower levels.  This also led to my enhancing the macros
output by regcharclass.pl to be at least as good (in terms of numbers of
branches, etc) as the hand-coded ones it replaces.

I also spotted a few bugs in existing code that hadn't been triggered
yet.

12 years agoutf8.h: Use machine generated IS_UTF8_CHAR()
Karl Williamson [Thu, 6 Sep 2012 02:56:09 +0000 (20:56 -0600)]
utf8.h: Use machine generated IS_UTF8_CHAR()

This takes the output of regen/regcharclass.pl for all the 1-4 byte
UTF8-representations of Unicode code points, and replaces the current
hand-rolled definition there.  It does this only for ASCII platforms,
leaving EBCDIC to be machine generated when run on such a platform.

I would rather have both versions to be regenerated each time it is
needed to save an EBCDIC dependency, but it takes more than 10 minutes
on my computer to process the 2 billion code points that have to be
checked for on ASCII platforms, and currently t/porting/regen.t runs
this program every times; and that slow down would be unacceptable.  If
this is ever run under EBCDIC, the macro should be machine computed
(very slowly).  So, even though there is an EBCDIC dependency, it has
essentially been solved.

12 years agoregen/regcharclass.pl: Add ability to restrict platforms
Karl Williamson [Thu, 6 Sep 2012 02:48:15 +0000 (20:48 -0600)]
regen/regcharclass.pl: Add ability to restrict platforms

This adds the capability to skip definitions if they are for other than
a desired platform.

12 years agoutf8.h: Remove some EBCDIC dependencies
Karl Williamson [Thu, 6 Sep 2012 02:32:29 +0000 (20:32 -0600)]
utf8.h: Remove some EBCDIC dependencies

regen/regcharclass.pl has been enhanced in previous commits so that it
generates as good code as these hand-defined macro definitions for
various UTF-8 constructs.  And, it should be able to generate EBCDIC
ones as well.  By using its definitions, we can remove the EBCDIC
dependencies for them.  It is quite possible that the EBCDIC versions
were wrong, since they have never been tested.  Even if
regcharclass.pl has bugs under EBCDIC, it is easier to find and fix
those in one place, than all the sundry definitions.

12 years agoregen/regcharclass.pl: Add optimization
Karl Williamson [Wed, 5 Sep 2012 21:18:09 +0000 (15:18 -0600)]
regen/regcharclass.pl: Add optimization

On UTF-8 input known to be valid, continuation bytes must be in the
range 0x80 .. 0x9F.  Therefore, any tests for being within those bounds
will always be true, and may be omitted.

12 years agoregen/regcharclass.pl: White-space only
Karl Williamson [Wed, 5 Sep 2012 21:14:59 +0000 (15:14 -0600)]
regen/regcharclass.pl: White-space only

Indent a newly-formed block

12 years agoregen/regcharclass.pl: Extend previously added optimization
Karl Williamson [Wed, 5 Sep 2012 21:00:52 +0000 (15:00 -0600)]
regen/regcharclass.pl: Extend previously added optimization

A previous commit added an optimization to save a branch in the
generated code at the expense of an extra mask when the input class has
certain characteristics.  This extends that to the case where
sub-portions of the class have similar characteristics.  The first
optimization for the entire class is moved to right before the new loop
that checks each range in it.

12 years agoregen/regcharclass.pl: Rmv always true components from gen'd macro
Karl Williamson [Wed, 5 Sep 2012 15:30:34 +0000 (09:30 -0600)]
regen/regcharclass.pl: Rmv always true components from gen'd macro

This adds a test and returns 1 from a subroutine if the condition will
always match; and in the caller it adds a check for that, and omits the
condition from the generated macro.

12 years agoregen/regcharclass.pl: Add an optimization
Karl Williamson [Tue, 4 Sep 2012 20:54:26 +0000 (14:54 -0600)]
regen/regcharclass.pl: Add an optimization

Branches can be eliminated from the macros that are generated here
by using a mask in cases where applicable.  This adds checking to see if
this optimization is possible, and applies it if so.

12 years agoregen/regcharclass.pl: Rename a variable
Karl Williamson [Wed, 5 Sep 2012 16:26:22 +0000 (10:26 -0600)]
regen/regcharclass.pl: Rename a variable

I find it confusing that the array element name is the same as the full array

12 years agoregen/regcharclass.pl: Pass options deeper into call stack
Karl Williamson [Tue, 4 Sep 2012 20:12:13 +0000 (14:12 -0600)]
regen/regcharclass.pl: Pass options deeper into call stack

This is to prepare for future commits which will act differently at the
deep level depending on some of the options.

12 years agoUse macro not swash for utf8 quotemeta
Karl Williamson [Mon, 3 Sep 2012 22:59:09 +0000 (16:59 -0600)]
Use macro not swash for utf8 quotemeta

The rules for matching whether an above-Latin1 code point are now saved
in a macro generated from a trie by regen/regcharclass.pl, and these are
now used by pp.c to test these cases.  This allows removal of a wrapper
subroutine, and also there is no need for dynamic loading at run-time
into a swash.

This macro is about as big as I'm comfortable compiling in, but it
saves the building of a hash that can grow over time, and removes a
subroutine and interpreter variables.  Indeed, performance benchmarks
show that it is about the same speed as a hash, but it does not require
having to load the rules in from disk the first time it is used.

12 years agoregen/regcharclass.pl: Add new output macro type
Karl Williamson [Mon, 3 Sep 2012 22:54:56 +0000 (16:54 -0600)]
regen/regcharclass.pl: Add new output macro type

The new type 'high' is used on only above-Latin1 code points.  It is
designed for code that already knows the tested code point is not
Latin1, and avoids unnecessary tests.

12 years agoregen/regcharclass.pl: Add documentation
Karl Williamson [Mon, 3 Sep 2012 00:29:42 +0000 (18:29 -0600)]
regen/regcharclass.pl: Add documentation

12 years agoregen/regcharclass.pl: Error check input better
Karl Williamson [Mon, 3 Sep 2012 00:28:19 +0000 (18:28 -0600)]
regen/regcharclass.pl: Error check input better

This makes sure that the modifiers specified in the input are known to
the program.

12 years agoregen/regcharclass.pl: Allow comments in input
Karl Williamson [Sun, 2 Sep 2012 22:48:14 +0000 (16:48 -0600)]
regen/regcharclass.pl: Allow comments in input

Lines whose first non-blank character is a '#' are now considered to be
comments, and ignored.  This allows the moving of some lines that have
been commented out back to after the __DATA__ where they really belong.

12 years agoregen/unicode_constants.pl: Add name parameter
Karl Williamson [Sun, 2 Sep 2012 21:58:41 +0000 (15:58 -0600)]
regen/unicode_constants.pl: Add name parameter

A future commit will want to use the first surrogate code point's UTF-8
value.  Add this to the generated macros, and give it a name, since
there is no official one.  The program has to be modified to cope with
this.

12 years agoMove 2 functions from utf8.c to regexec.c
Karl Williamson [Sun, 2 Sep 2012 21:29:32 +0000 (15:29 -0600)]
Move 2 functions from utf8.c to regexec.c

One of these functions is currently commented out.  The other is called
only in regexec.c in one place, and was recently revised to no longer
require the static function in utf8.c that it formerly called.  They can
be made static inline.

12 years agoregexec.c: Use new macros instead of swashes
Karl Williamson [Sun, 2 Sep 2012 20:46:38 +0000 (14:46 -0600)]
regexec.c: Use new macros instead of swashes

A previous commit has caused macros to be generated that will match
Unicode code points of interest to the \X algorithm.  This patch uses
them.  This speeds up modern Korean processing by 15%.

Together with recent previous commits, the throughput of modern Korean
under \X has more than doubled, and is now comparable to other
languages (which have increased themselved by 35%)

12 years agoregen/regcharclass.pl: Generate macros for \X processing
Karl Williamson [Sun, 2 Sep 2012 20:31:59 +0000 (14:31 -0600)]
regen/regcharclass.pl: Generate macros for \X processing

\X is implemented in regexec.c as a complicated series of property
look-ups.  It turns out that many of those are for just a few code
points, and so can be more efficiently implemented with a macro than a
swash.  This generates those.

12 years agoregen/regcharclass.pl: Change to work on an empty class
Karl Williamson [Sun, 2 Sep 2012 20:26:20 +0000 (14:26 -0600)]
regen/regcharclass.pl: Change to work on an empty class

Future commits will add Unicode properties for this to generate macros,
and some of them may be empty in some Unicode releases.  This just
causes such a generated macro to evaluate to 0.

12 years agoregen/regcharclass.pl: Fix bug for character '0'
Karl Williamson [Fri, 31 Aug 2012 23:04:30 +0000 (17:04 -0600)]
regen/regcharclass.pl: Fix bug for character '0'

The character '0' could be omitted from some generated macros due to
it's testing the value of a hash entry (getting 0 or false) instead
of if it exists or not.

12 years agoregen/regcharclass.pl: Work on EBCDIC platforms
Karl Williamson [Fri, 31 Aug 2012 23:00:27 +0000 (17:00 -0600)]
regen/regcharclass.pl: Work on EBCDIC platforms

This will now automatically generate macros for non-ASCII platforms,
by mapping the Unicode input to native output.

Doing this will allow several cases of EBCDIC dependencies in other code
to be removed, and fixes the bug that this previously had with non-ASCII
platforms.

12 years agoregen/regcharclass.pl: Remove Encode:: dependency
Karl Williamson [Mon, 3 Sep 2012 22:22:32 +0000 (16:22 -0600)]
regen/regcharclass.pl: Remove Encode:: dependency

Newer options to unpack alleviate the need for Encode, and run faster.

12 years agoregen/regcharclass.pl: Handle ranges, \p{}
Karl Williamson [Fri, 31 Aug 2012 22:39:31 +0000 (16:39 -0600)]
regen/regcharclass.pl: Handle ranges, \p{}

Instead of having to list all code points in a class, you can now use
\p{} or a range.

This changes some classes to use the \p{}, so that any changes Unicode
makes to the definitions don't have to manually be done here as well.

12 years agoutf8.h: Save a branch in a macro
Karl Williamson [Sun, 2 Sep 2012 19:09:48 +0000 (13:09 -0600)]
utf8.h: Save a branch in a macro

By adding a mask, we can save a branch.  The two expressions match the
exact same code points.

12 years agoutf8.h: White-space only
Karl Williamson [Sun, 2 Sep 2012 19:08:21 +0000 (13:08 -0600)]
utf8.h: White-space only

This reflows some lines to fit into 80 columns

12 years agoutf8.h: Correct improper EBCDIC conversion
Karl Williamson [Sun, 2 Sep 2012 19:01:50 +0000 (13:01 -0600)]
utf8.h: Correct improper EBCDIC conversion

These macros were incorrect for EBCDIC.  The relationships are based on
I8, the intermediate-utf8 defined for UTF-EBCDIC, not the final encoding.
I was the culprit who did this orginally; I was confused by the names of
the conversion macros.  I'm adding names that are clearer to me; which
have already been defined in utfebcdic.h, but weren't defined for
non-EBCDIC platforms.

12 years agoext/B/B.xs: Remove EBCDIC dependency
Karl Williamson [Sun, 2 Sep 2012 16:37:26 +0000 (10:37 -0600)]
ext/B/B.xs: Remove EBCDIC dependency

These are unnecessary EBCDIC dependencies: It uses isPRINT() on EBCDIC,
and an expression on ASCII, but isPRINT() is defined to be precisely
that expression on ASCII platforms.

12 years agoRemove some EBCDIC dependencies
Karl Williamson [Sun, 2 Sep 2012 16:30:32 +0000 (10:30 -0600)]
Remove some EBCDIC dependencies

A new regen'd header file has been created that contains the native
values for certain characters.  By using those macros, we can eliminate
EBCDIC dependencies.

12 years agoRename regen'd hdr to reflect expanded capabilities
Karl Williamson [Sun, 2 Sep 2012 15:58:43 +0000 (09:58 -0600)]
Rename regen'd hdr to reflect expanded capabilities

The recently added utf8_strings.h has been expanded to include more than
just strings.  I'm renaming it to avoid confusion.

12 years agoregen/utf8_strings.pl: Add ability to get native charset
Karl Williamson [Sun, 2 Sep 2012 15:44:22 +0000 (09:44 -0600)]
regen/utf8_strings.pl: Add ability to get native charset

This adds a new capability to this program: to input a Unicode code point and
create a macro that expands to the platform's native value for it.

This will allow removal of a bunch of EBCDIC dependencies in the core.

12 years agoregen/utf8_strings.pl: Allow explicit default on input
Karl Williamson [Sun, 2 Sep 2012 15:28:55 +0000 (09:28 -0600)]
regen/utf8_strings.pl: Allow explicit default on input

An input line without a command is considered to be a request for the
UTF-8 encoded string of the code point.  This allows an explicit
'string' to be used.

12 years agoregen/utf8_strings.pl: Copy empty input lines to output
Karl Williamson [Sun, 2 Sep 2012 15:22:16 +0000 (09:22 -0600)]
regen/utf8_strings.pl: Copy empty input lines to output

This allows the generated .h to look better.

12 years ago/regcharclass.pl, utf8_strings.pl: Add guard to .h
Karl Williamson [Fri, 31 Aug 2012 23:41:14 +0000 (17:41 -0600)]
/regcharclass.pl, utf8_strings.pl: Add guard to .h

Future commits will have other headers #include the headers generated by
these programs.  It is best to guard against the preprocessor from
trying to process these twice

12 years agoUnicode/UCD.pm: Clarify pod
Karl Williamson [Fri, 31 Aug 2012 23:39:04 +0000 (17:39 -0600)]
Unicode/UCD.pm: Clarify pod

12 years agoFix \X handling for Unicode 5.1 - 6.0
Karl Williamson [Tue, 28 Aug 2012 23:41:41 +0000 (17:41 -0600)]
Fix \X handling for Unicode 5.1 - 6.0

Commit 27d4fc33343f0dd4287f0e7b9e6b4ff67c5d8399 neglected to include a
change required for a few Unicode releases where the \X prepend property
is not empty.  This does that, and suppresses a mktables warning for
Unicode releases prior to 6.2

12 years agoregcomp.c: Wrap some long lines
Karl Williamson [Thu, 6 Sep 2012 16:01:38 +0000 (10:01 -0600)]
regcomp.c: Wrap some long lines

12 years agoperldelta for 8700fd3876
Steve Hay [Thu, 13 Sep 2012 22:27:22 +0000 (23:27 +0100)]
perldelta for 8700fd3876

12 years agoDocument how to create and use smoke-me branches
Steve Hay [Thu, 13 Sep 2012 22:09:19 +0000 (23:09 +0100)]
Document how to create and use smoke-me branches

The instructions are based on the following helpful email from Tony Cook:
http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2012-09/msg00747.html
after I tested them myself in course of commit 8700fd3876.

12 years agoFix a couple of headings in perlgit.pod which look to be the wrong level
Steve Hay [Thu, 13 Sep 2012 21:16:44 +0000 (22:16 +0100)]
Fix a couple of headings in perlgit.pod which look to be the wrong level

12 years agoAvoid POSIX::close when closing files by descriptor in IPC::Open3
Steve Hay [Wed, 12 Sep 2012 22:36:41 +0000 (23:36 +0100)]
Avoid POSIX::close when closing files by descriptor in IPC::Open3

Closing a file descriptor with POSIX::close bypasses PerlIO's ref-counting
of file descriptors and leads to MSVC++'s invalid parameter handler being
triggered when the PerlIO stream is closed later because that attempts to
close the underlying file descriptor again, but it's already closed.

So instead, we effectively fdopen() a new PerlIO stream and then close it
again to effect the closure of the file descriptor.

12 years agowhoops, move this back where it was
Jesse Luehrs [Thu, 13 Sep 2012 00:15:59 +0000 (19:15 -0500)]
whoops, move this back where it was

apparently utf8->SWASHNEW calls "require 'unicore/Heavy.pl'" too

12 years agoop.c: Document newGIVENOP(..., 0)
Father Chrysostomos [Wed, 12 Sep 2012 23:19:01 +0000 (16:19 -0700)]
op.c: Document newGIVENOP(..., 0)

Something I missed in b5a648148c.

12 years agoFix listop-hash-infix parsing
Father Chrysostomos [Wed, 12 Sep 2012 21:03:08 +0000 (14:03 -0700)]
Fix listop-hash-infix parsing

With some list operators, this happens:

$ ./miniperl -e 'warn({$_ => 1} + 1) if 0'
syntax error at -e line 1, near "} +"
Execution of -e aborted due to compilation errors.

Putting + before the { or changing warn to print makes the prob-
lem go away.

The lexer is losing track of what token it expects next, so it ends
up interpreting the + as a unary plus, instead of an infix plus.  The
parser doesn’t like that.

It happens because of this logic under case '{' (aka leftbracket:) in
toke.c:yylex:

switch (PL_expect) {
case XTERM:
    if (PL_oldoldbufptr == PL_last_lop)
PL_lex_brackstack[PL_lex_brackets++] = XTERM;
    else
PL_lex_brackstack[PL_lex_brackets++] = XOPERATOR;
    PL_lex_allbrackets++;
    OPERATOR(HASHBRACK);

The value we put on the brackstack is what we expect to find after the
closing brace (case '}' pops it off).

This particular if/else goes all the back to ef6361f9c226 (perl
5.000), or at least that was when it moved inside the XTERM case.
Before that, we had this:

if (oldoldbufptr == last_lop)
    lex_brackstack[lex_brackets++] = XTERM;
else
    lex_brackstack[lex_brackets++] = XOPERATOR;
if (expect == XTERM)
    OPERATOR(HASHBRACK);

So it appears that the XTERM/XOPERATOR distinction, based on last_lop
was the ‘old’ (and wrong) way of doing it, but it had to be changed in
perl 5.000 for cases other than XTERM.  That it remained for XTERM was
probably an oversight, which is easy to understand, since I seem to be
the first one to stumble across this after 18 years (what’s the rele-
vant Klortho number?).

Removing this last_lop check causes no tests to fail.  And it makes
sense, since anything coming right after an anonymous hash that could
be either an infix or prefix operator must be infix.

12 years agotoke.c: Under -DT, dump complement properly
Father Chrysostomos [Wed, 12 Sep 2012 20:31:40 +0000 (13:31 -0700)]
toke.c: Under -DT, dump complement properly

Before:

$ ./miniperl -DT -e '~foo'
....
### 0:LEX_NORMAL/XSTATE ""
### <== ?? 126
....

After:

$ ./miniperl -DT -e '~foo'
....
### 0:LEX_NORMAL/XSTATE ""
### <== '~'
....

12 years agoAdd PL_subname to the save stack
Peter Martini [Sun, 9 Sep 2012 14:45:11 +0000 (10:45 -0400)]
Add PL_subname to the save stack

Otherwise, PL_subname is left as utf8::SWASHNEW after isIDFIRST_lazy_if
(etc) is called in UTF context

12 years agoEradicate race condition in t/op/sigsystem.t (#114562)
Leon Timmermans [Wed, 12 Sep 2012 13:38:44 +0000 (15:38 +0200)]
Eradicate race condition in t/op/sigsystem.t (#114562)

12 years agostop ""-overloaded Regex recursing
David Mitchell [Wed, 12 Sep 2012 11:36:08 +0000 (12:36 +0100)]
stop ""-overloaded Regex recursing

There was code to detect this, but it checked for the returned value being
the same as before, but in this case it was returning a *new* temporary
reference to the same Regexp object; so check for that too.

12 years agoadd test for 6502e08, s/(.)/die/e
David Mitchell [Wed, 12 Sep 2012 11:03:22 +0000 (12:03 +0100)]
add test for 6502e08, s/(.)/die/e

Forgot to add a test along with the commit that fixed this

12 years agoperldelta: add recent regex API changes
David Mitchell [Wed, 12 Sep 2012 10:51:03 +0000 (11:51 +0100)]
perldelta: add recent regex API changes

12 years agoupdate docs for $`, $&, $' changes
David Mitchell [Wed, 12 Sep 2012 10:32:12 +0000 (11:32 +0100)]
update docs for $`, $&, $' changes

mention that they're now detected individually, and mention in reapi
the new RX_BUFF_IDX_* symbolic constants.

12 years agoRefactor to use test.pl instead of making TAP by hand. Add test names.
Colin Kuskie [Sun, 9 Sep 2012 20:26:49 +0000 (13:26 -0700)]
Refactor to use test.pl instead of making TAP by hand. Add test names.

12 years agoUnify CvDEPTH for formats and subs
Father Chrysostomos [Wed, 12 Sep 2012 03:22:57 +0000 (20:22 -0700)]
Unify CvDEPTH for formats and subs

As Dave Mitchell pointed out, while putting the CvDEPTH field for for-
mats in the SvCUR slot might save memory for formats, it slows down
sub calls because CvDEPTH is used on subs in very hot code paths.
Checking the SvTYPE to determine which field to use should not be
necessary.

12 years agopad.c: Share pad name lists between clones
Father Chrysostomos [Mon, 3 Sep 2012 05:27:52 +0000 (22:27 -0700)]
pad.c: Share pad name lists between clones

Pad names are immutable once the sub is compiled.  They are shared
between clones.  Instead of creating a new array containing the same
pad name SVs, just share the whole array.

cv_undef does not need to modify the pad name list when removing an
anonymous sub, so we can just delete that code.  That was the only
thing modifying them between compilation and freeing, as far as I
could tell.

12 years agoUpdated Search::Dict to 1.07 as on CPAN
David Golden [Fri, 30 Mar 2012 18:02:37 +0000 (20:02 +0200)]
Updated Search::Dict to 1.07 as on CPAN

12 years agoPerldelta up to 5e96eee9
Florian Ragwitz [Tue, 11 Sep 2012 14:53:37 +0000 (10:53 -0400)]
Perldelta up to 5e96eee9

12 years agoText::Abbrev has been synchronised to CPAN
Florian Ragwitz [Tue, 11 Sep 2012 14:36:31 +0000 (10:36 -0400)]
Text::Abbrev has been synchronised to CPAN

12 years agoTerm::ReadLine has been synchronised to CPAN
Florian Ragwitz [Tue, 11 Sep 2012 14:32:12 +0000 (10:32 -0400)]
Term::ReadLine has been synchronised to CPAN

12 years agoExtUtils::Manifest has been synchronised to CPAN
Florian Ragwitz [Tue, 11 Sep 2012 14:26:29 +0000 (10:26 -0400)]
ExtUtils::Manifest has been synchronised to CPAN

12 years agoDumpvalue has been synchronised to CPAN
Florian Ragwitz [Tue, 11 Sep 2012 14:21:18 +0000 (10:21 -0400)]
Dumpvalue has been synchronised to CPAN

12 years agoSynchronise bignum with CPAN
Florian Ragwitz [Tue, 11 Sep 2012 14:14:46 +0000 (10:14 -0400)]
Synchronise bignum with CPAN

12 years agoAutomatically create core-cpan-diff cache dir
Florian Ragwitz [Tue, 11 Sep 2012 14:06:36 +0000 (10:06 -0400)]
Automatically create core-cpan-diff cache dir

12 years agoB::Lint hsa been synchronised to CPAN
Florian Ragwitz [Tue, 11 Sep 2012 14:02:58 +0000 (10:02 -0400)]
B::Lint hsa been synchronised to CPAN

12 years agoautouse has synchronised to CPAN
Florian Ragwitz [Tue, 11 Sep 2012 13:56:22 +0000 (09:56 -0400)]
autouse has synchronised to CPAN

12 years agoTell Maintainers.pl about the Storable 2.39 upgrade
Florian Ragwitz [Tue, 11 Sep 2012 13:44:23 +0000 (09:44 -0400)]
Tell Maintainers.pl about the Storable 2.39 upgrade

12 years agoUpdate perldelta entry for [perl #114496].
Steve Hay [Tue, 11 Sep 2012 07:51:11 +0000 (08:51 +0100)]
Update perldelta entry for [perl #114496].

Improved text by Tony C, from the bug report.

12 years agoSilence invalid parameter messages from win32_signal
Steve Hay [Tue, 11 Sep 2012 07:36:03 +0000 (08:36 +0100)]
Silence invalid parameter messages from win32_signal

This is the first step towards enabling the invalid parameter handler
without it causing undue noise. In this case the invalid parameters are
intentional, so provide a means to silence messages about them.

There is still noise from win32_close() and win32_select() which needs
resolving by some means too before the handler can be switched on without
its output causing test failures.

12 years agoANSIfy output from invalid parameter handler, and write it to stderr
Steve Hay [Tue, 11 Sep 2012 07:32:41 +0000 (08:32 +0100)]
ANSIfy output from invalid parameter handler, and write it to stderr

The function, file and expression are very unlikely to contain anything
requiring UTF-16 output, and the output is less likely to interfere with
anything when written to stderr rather than stdout.

Note that the function doesn't currently do anything without hacking the
makefiles because we don't currently build with _DEBUG and the debug CRT.
I haven't changed that yet (other than locally) because there is actually
some output from it which causes a couple of tests to fail.

12 years agoForward declare static functions in win32/win32.c
Steve Hay [Tue, 11 Sep 2012 07:31:34 +0000 (08:31 +0100)]
Forward declare static functions in win32/win32.c

This makes calling them easier without worrying about the order of
definition.

12 years agoIdentify MallocCfg* globals as variables, not functions.
Craig A. Berry [Tue, 11 Sep 2012 01:40:08 +0000 (20:40 -0500)]
Identify MallocCfg* globals as variables, not functions.

Otherwise building on VMS with -Dusemymalloc=y fails because we
enter them as procedures in the linker options file and the linker
knows we're lying and will have none of it.

12 years agoBump version to 2.39 because I botched the 2.38 release
Abhijit Menon-Sen [Tue, 11 Sep 2012 01:34:06 +0000 (07:04 +0530)]
Bump version to 2.39 because I botched the 2.38 release

12 years agoAdd changelog entry for 2.38
Abhijit Menon-Sen [Tue, 11 Sep 2012 01:24:17 +0000 (06:54 +0530)]
Add changelog entry for 2.38

12 years agoAdd more tests, Revert back to C-style for loops
Shlomi Fish [Tue, 11 Sep 2012 01:08:05 +0000 (21:08 -0400)]
Add more tests, Revert back to C-style for loops

This patch to lib/perl5db.pl and lib/perl5db.t adds more tests for the L
and S commands and reverts some changes from C-style for loops to
while+continue loops which were not very popular.

12 years agoRemove some set but unused variables
Florian Ragwitz [Mon, 10 Sep 2012 21:14:59 +0000 (17:14 -0400)]
Remove some set but unused variables

Thanks, gcc, for letting me know.

12 years agoPerldelta up to 9e533305
Florian Ragwitz [Mon, 10 Sep 2012 17:22:10 +0000 (13:22 -0400)]
Perldelta up to 9e533305

12 years agoStop CPAN from indexing mad/
Florian Ragwitz [Sat, 26 May 2012 21:15:43 +0000 (23:15 +0200)]
Stop CPAN from indexing mad/

12 years agoCorrect obvious typos in acknowledgements list
Dominic Hargreaves [Mon, 10 Sep 2012 18:33:00 +0000 (19:33 +0100)]
Correct obvious typos in acknowledgements list

12 years agoFix [perl #114812] Configure not finding isblank().
Andy Dougherty [Mon, 10 Sep 2012 12:35:16 +0000 (08:35 -0400)]
Fix [perl #114812] Configure not finding isblank().

Configure would not find isblank() when run with g++ because
the probe used exit() without including <stdlib.h>.  The simplest fix
is to have the probe use return instead.

12 years agoRefactor t/op/my.t to use test.pl instead of making TAP by hand
Colin Kuskie [Sun, 9 Sep 2012 20:33:05 +0000 (13:33 -0700)]
Refactor t/op/my.t to use test.pl instead of making TAP by hand

12 years agoRefactor t/op/cond.t to use test.pl instead of making TAP by hand
Colin Kuskie (via RT) [Sat, 8 Sep 2012 22:31:53 +0000 (15:31 -0700)]
Refactor t/op/cond.t to use test.pl instead of making TAP by hand

12 years agoRefactor t/porting/customized to use test.pl instead of making TAP by hand
Colin Kuskie (via RT) [Mon, 10 Sep 2012 00:32:53 +0000 (17:32 -0700)]
Refactor t/porting/customized to use test.pl instead of making TAP by hand

12 years agoFix C++, MYMALLOC, sdbm combination.
Craig A. Berry [Mon, 10 Sep 2012 02:27:44 +0000 (21:27 -0500)]
Fix C++, MYMALLOC, sdbm combination.

The prototypes for the home-grown malloc replacements were not
protected with extern "C" declarations, so linking the SDBM_File
extension failed when configuring with -Dusemymalloc=y and building
with C++.

12 years agoOut of memory message should not allocate memory.
Craig A. Berry [Mon, 3 Sep 2012 02:30:55 +0000 (21:30 -0500)]
Out of memory message should not allocate memory.

This fixes [perl #40595].  When Perl_malloc reports an out of
memory error, it should not make calls to PerlIO functions that
may turn around and allocate memory using Perl_malloc.  A simple
write() should be ok, though.  Inspired by S_write_no_mem() from
util.c.  Also replaces the local write2 function, which did the
same thing slightly differently.

Under -DDEBUGGING, there are other calls to PerlIO_printf that are
also likely unsafe, but that problem is not addressed here.

12 years agofix s/(.)/die/e
David Mitchell [Sat, 8 Sep 2012 19:17:42 +0000 (20:17 +0100)]
fix s/(.)/die/e

Commit 6502e08109cd003b2cdf39bc94ef35e52203240b introduced copying just
the part of the regex string that were needed; but piggy-backing on that
commit was a temporary change I made that I forgot to undo, which - it
turns out - causes SEGVs and similar when the replacement part of a
substitution dies.

This commits reverts that change.

Spotted as
    Bleadperl v5.17.3-255-g6502e08 breaks GAAS/URI-1.60.tar.gz
(not assigned an RT ticket number yet)

12 years ago[MERGE] only copy bits of regex match string
David Mitchell [Sat, 8 Sep 2012 14:42:56 +0000 (15:42 +0100)]
[MERGE] only copy bits of regex match string

When making a copy of the string being matched against (so that $1, $&
et al continue to show the correct value even if the original string is
subsequently modified), only copy that substring of the original string
needed for the capture variables, rather than copying the whole string.

This is a big win for code like

    $&;
    $_ = 'x' x 1_000_000;
    1 while /(.)/;

Also, when pessimizing if the code contains $`, $& or $', record
the presence of each variable separately, so that the determination of the
substring range is based on each variable separately. So performance-wise,

   $&; /x/

is now roughly equivalent to

   /(x)/

whereas previously it was like

   /^(.*)(x)(.*)$/

and

   $&; $'; /x/

is now roughly equivalent to

   /(x)(.*)$/

etc.

Finally, this code (when not in the presence of $& etc)

    $_ = 'x' x 1_000_000;
    1 while /(.)/;

used to skip the buffer copy for performance reasons, but suffered from $1
etc changing if the original string changed. That's now been fixed too.

12 years agofix a bug in handling $+[0] and unicode
David Mitchell [Fri, 7 Sep 2012 12:32:11 +0000 (13:32 +0100)]
fix a bug in handling $+[0] and unicode

The code to decide what substring of a pattern target to copy for the
sake of $1, $& etc, would, in the absence of $&, only copy the minimum
range needed to cover $1,$2,...., which might be a shorter range than
what $& covers. This is fine most of the time, but, when calculating
$+[0] on a unicode string, it needs a copy of the whole part of the string
covered by $&, since it needs to convert the byte offest into a char
offset.
So to fix this, always copy as a minimum, the $& range.
I suppose we could be more clever about this: detect the presence
of @+ in the code, only do it for UTF8 etc; but this is simple
and non-fragile.