summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Ing-Simmons <nik@tiuk.ti.com>2000-11-18 11:03:32 +0000
committerNick Ing-Simmons <nik@tiuk.ti.com>2000-11-18 11:03:32 +0000
commit579de012b31c51e885b06b54d62f0b1ebd2f0b18 (patch)
tree0b7e9a81a122e7a917f47b847b64ed101ac7f3b9
parent7069680d55e92ff6b4f98340129a4802e90c6fb9 (diff)
parent355cf289892437cde1db03ad0bdddab5c4218746 (diff)
downloadperl-579de012b31c51e885b06b54d62f0b1ebd2f0b18.tar.gz
Integrate mainline
p4raw-id: //depot/perlio@7735
-rw-r--r--Changes154
-rw-r--r--README.amiga29
-rw-r--r--README.win3296
-rw-r--r--patchlevel.h2
-rw-r--r--pod/perlfunc.pod23
-rw-r--r--pp.c8
-rw-r--r--regcomp.c42
-rw-r--r--regexec.c8
-rw-r--r--t/op/re_tests4
9 files changed, 289 insertions, 77 deletions
diff --git a/Changes b/Changes
index 03361bd0dc..2768ef7712 100644
--- a/Changes
+++ b/Changes
@@ -32,6 +32,160 @@ Version v5.7.0 Development release working toward v5.8
--------------
____________________________________________________________________________
+[ 7733] By: jhi on 2000/11/18 00:32:54
+ Log: Subject: [PATCH 5.7.0] restore match data on backtracing
+ From: Ilya Zakharevich <ilya@math.ohio-state.edu>
+ Date: Fri, 17 Nov 2000 17:28:02 -0500
+ Message-ID: <20001117172802.A1032@monk.mps.ohio-state.edu>
+ Branch: perl
+ ! regcomp.c regexec.c t/op/re_tests
+____________________________________________________________________________
+[ 7732] By: jhi on 2000/11/18 00:28:56
+ Log: Sparc 64-bit pack() fix from Jens Hamisch.
+ Branch: perl
+ ! pp.c
+____________________________________________________________________________
+[ 7731] By: jhi on 2000/11/18 00:18:39
+ Log: Explain in more detail the {} syntax ambiguousity.
+
+ Subject: [PATCH] Re: [ID 20001117.003] map { "$_", 1} @array is syntax error
+ From: Nicholas Clark <nick@ccl4.org>
+ Date: Fri, 17 Nov 2000 22:10:28 +0000
+ Message-ID: <20001117221028.A88930@plum.flirble.org>
+ Branch: perl
+ ! pod/perlfunc.pod
+____________________________________________________________________________
+[ 7730] By: jhi on 2000/11/18 00:12:18
+ Log: Subject: Fix for README.amiga (20000323.033)
+ From: "Stephen P. Potter" <spp@spotter.yi.org>
+ Date: Fri, 17 Nov 2000 12:25:51 -0500
+ Message-Id: <200011171725.MAA05768@spotter.yi.org>
+ Branch: perl
+ ! README.amiga
+____________________________________________________________________________
+[ 7729] By: jhi on 2000/11/18 00:08:34
+ Log: Subject: [PATCH 5.6.0 README.win32] very minor typos
+ From: "A. C. Yardley" <yardley@tanet.net>
+ Date: Mon, 3 Apr 2000 11:35:33 -0700
+ Message-ID: <3483.000403@tanet.net>
+ Branch: perl
+ ! README.win32
+____________________________________________________________________________
+[ 7726] By: jhi on 2000/11/17 14:15:49
+ Log: Subject: Fix for 20000815.006
+ From: "Stephen P. Potter" <spp@spotter.yi.org>
+ Date: Fri, 17 Nov 2000 08:57:45 -0500
+ Message-Id: <200011171357.IAA05122@spotter.yi.org>
+
+ It's really 20000518.006.
+ Branch: perl
+ ! pod/perlmodlib.PL
+____________________________________________________________________________
+[ 7725] By: jhi on 2000/11/17 14:12:31
+ Log: Subject: Fix for 20000409.001
+ From: "Stephen P. Potter" <spp@spotter.yi.org>
+ Date: Fri, 17 Nov 2000 08:55:45 -0500
+ Message-Id: <200011171355.IAA05104@spotter.yi.org>
+ Branch: perl
+ ! pod/perlfaq9.pod
+____________________________________________________________________________
+[ 7724] By: jhi on 2000/11/17 14:08:58
+ Log: Undo #7627 now that we have =head3.
+ Branch: perl
+ ! pod/perlhack.pod
+____________________________________________________________________________
+[ 7723] By: jhi on 2000/11/17 14:04:09
+ Log: As surmised the #7719 wasn't a good move.
+ Branch: perl
+ ! hints/solaris_2.sh
+____________________________________________________________________________
+[ 7722] By: jhi on 2000/11/17 13:59:04
+ Log: Also the 64bitall hints can be either here or there.
+ Branch: perl
+ ! hints/solaris_2.sh
+____________________________________________________________________________
+[ 7721] By: jhi on 2000/11/17 02:26:23
+ Log: Test tweak for the open pragma.
+ Branch: perl
+ ! t/lib/b.t
+____________________________________________________________________________
+[ 7720] By: jhi on 2000/11/17 00:23:22
+ Log: The long double hints can be here or there.
+ Branch: perl
+ ! hints/solaris_2.sh
+____________________________________________________________________________
+[ 7719] By: jhi on 2000/11/17 00:14:06
+ Log: For Solaris use64bitall the stdchar needs a little bit of help.
+ Branch: perl
+ ! hints/solaris_2.sh
+____________________________________________________________________________
+[ 7718] By: jhi on 2000/11/16 23:27:34
+ Log: Subject: Re: Bug in Carp::Heavy/5.6.0?
+ From: Wolfgang Laun <Wolfgang.Laun@alcatel.at>
+ Date: Wed, 15 Nov 2000 08:56:32 +0100
+ Message-ID: <3A1241B0.64477E00@alcatel.at>
+ Branch: perl
+ ! lib/Carp/Heavy.pm
+____________________________________________________________________________
+[ 7717] By: jhi on 2000/11/16 23:23:29
+ Log: Subject: [PATCH] Re: 20001101.003 PDL
+ From: Nicholas Clark <nick@ccl4.org>
+ Date: Thu, 16 Nov 2000 16:48:25 +0000
+ Message-ID: <20001116164825.B93487@plum.flirble.org>
+ Branch: perl
+ ! lib/ExtUtils/xsubpp pod/perlxs.pod pod/perlxstut.pod
+____________________________________________________________________________
+[ 7716] By: jhi on 2000/11/16 23:21:31
+ Log: Subject: [PATCH] Re: [p5p] [PATCH perlpod.pod] Digging into the =head
+ From: "Casey R. Tweten" <crt@kiski.net>
+ Date: Thu, 16 Nov 2000 12:02:47 -0500 (EST)
+ Message-ID: <Pine.OSF.4.21.0011161200410.700-100000@home.kiski.net>
+ Branch: perl
+ ! lib/Pod/Checker.pm pod/perlpod.pod
+____________________________________________________________________________
+[ 7715] By: jhi on 2000/11/16 23:19:40
+ Log: Avoid an infinite loop in VMS when utils scripts are run
+ with no arguments, from Charles Lane.
+ Branch: perl
+ ! configure.com
+____________________________________________________________________________
+[ 7714] By: jhi on 2000/11/16 23:17:08
+ Log: Subject: perllocale.pod changes
+ From: "Konovalov, Vadim" <vkonovalov@lucent.com>
+ Date: Mon, 13 Nov 2000 10:09:22 +0300
+ Message-ID: <402099F49BEED211999700805FC7359F825416@ru0028exch01.spb.lucent.com>
+ Branch: perl
+ ! pod/perllocale.pod
+____________________________________________________________________________
+[ 7713] By: jhi on 2000/11/16 23:14:06
+ Log: Integrate perlio.
+ Branch: perl
+ !> doio.c perlio.c perlio.h util.c
+____________________________________________________________________________
+[ 7710] By: jhi on 2000/11/16 15:46:05
+ Log: Add HAS_SBRK_PROTO.
+ Branch: metaconfig/U/perl
+ + d_sbrkproto.U
+ Branch: perl
+ ! Configure Porting/Glossary Porting/config.sh Porting/config_H
+ ! config_h.SH configure.com epoc/config.sh malloc.c uconfig.h
+ ! uconfig.sh vos/config.alpha.def vos/config.alpha.h
+ ! vos/config.ga.def vos/config.ga.h win32/config.bc
+ ! win32/config.gc win32/config.vc
+____________________________________________________________________________
+[ 7708] By: jhi on 2000/11/16 05:33:03
+ Log: These files are text, not binary.
+ Branch: perl
+ ! ext/Encode/Encode/iso8859-10.enc
+ ! ext/Encode/Encode/iso8859-13.enc
+ ! ext/Encode/Encode/iso8859-14.enc
+ ! ext/Encode/Encode/iso8859-15.enc
+____________________________________________________________________________
+[ 7707] By: jhi on 2000/11/16 01:53:37
+ Log: Update Changes.
+ Branch: perl
+ ! Changes patchlevel.h
+____________________________________________________________________________
[ 7706] By: jhi on 2000/11/16 01:35:59
Log: More #undefing of stdio.
Branch: perl
diff --git a/README.amiga b/README.amiga
index 8951f355a0..fd8e922d76 100644
--- a/README.amiga
+++ b/README.amiga
@@ -8,14 +8,11 @@ perlamiga - Perl under Amiga OS (possibly very outdated information)
=head1 SYNOPSIS
-NOTE: No one has reported building Perl on the Amiga in a long
-time. The following information is highly unlikely to be correct.
-If you would like to help the Amiga port to stay current, see:
+NOTE: The following information is highly unlikely to be correct.
+A recent version of perl for the Amiga can be found at the Aminet site:
http://us.aminet.net/aminet/dirs/dev_gg.html
-for Amiga resources and information.
-
One can read this document in the following formats:
man perlamiga
@@ -62,12 +59,11 @@ Contents
You need the Unix emulation for AmigaOS, whose most important part is
B<ixemul.library>. For a minimum setup, get the following archives from
-ftp://ftp.ninemoons.com/pub/ade/current or a mirror:
+the Aminet archives (http://www.aminet.net/~aminet/):
-ixemul-46.0-bin.lha
-ixemul-46.0-env-bin.lha
-pdksh-4.9-bin.lha
-ADE-misc-bin.lha
+ixemul-bin.lha
+ixemul-env-bin.lha
+pdksh-bin.lha
Note that there might be newer versions available by the time you read
this.
@@ -126,11 +122,11 @@ deficiencies in the UNIX-emulation, most notably:
Change to the installation directory (most probably ADE:), and
extract the binary distribution:
-lha -mraxe x perl-5.003-bin.lha
+lha -mraxe x perl-$VERSION-bin.lha
or
-tar xvzpf perl-5.003-bin.tgz
+tar xvzpf perl-$VERSION-bin.tgz
(Of course you need lha or tar and gunzip for this.)
@@ -189,16 +185,15 @@ Here we discuss how to build Perl under AmigaOS.
=head2 Prerequisites
-You need to have the latest B<ADE> (Amiga Developers Environment)
-from ftp://ftp.ninemoons.com/pub/ade/current.
-Also, you need a lot of free memory, probably at least 8MB.
+You need to have the latest B<ixemul> (Unix emulation for Amiga)
+from Aminet.
=head2 Getting the perl source
You can either get the latest perl-for-amiga source from Ninemoons
and extract it with:
- tar xvzpf perl-5.004-src.tgz
+ tar xvzpf perl-$VERSION-src.tgz
or get the official source from CPAN:
@@ -206,7 +201,7 @@ or get the official source from CPAN:
Extract it like this
- tar xvzpf perl5.004.tar.gz
+ tar xvzpf perl$VERSION.tar.gz
You will see a message about errors while extracting F<Configure>. This
is normal and expected. (There is a conflict with a similarly-named file
diff --git a/README.win32 b/README.win32
index dc90adac30..fc4dc56753 100644
--- a/README.win32
+++ b/README.win32
@@ -14,7 +14,7 @@ These are instructions for building Perl under Windows (9x, NT and
=head1 DESCRIPTION
Before you start, you should glance through the README file
-found in the top-level directory where the Perl distribution
+found in the top-level directory to which the Perl distribution
was extracted. Make sure you read and understand the terms under
which this software is being distributed.
@@ -28,10 +28,10 @@ particular, you can safely ignore any information that talks about
You may also want to look at two other options for building
a perl that will work on Windows NT: the README.cygwin and
-README.os2 files, which each give a different set of rules to build
-a Perl that will work on Win32 platforms. Those two methods will
-probably enable you to build a more Unix-compatible perl, but you
-will also need to download and use various other build-time and
+README.os2 files, each of which give a different set of rules to
+build a Perl that will work on Win32 platforms. Those two methods
+will probably enable you to build a more Unix-compatible perl, but
+you will also need to download and use various other build-time and
run-time support software described in those files.
This set of instructions is meant to describe a so-called "native"
@@ -70,9 +70,9 @@ A port of dmake for Windows is available from:
http://www.cpan.org/authors/id/GSAR/dmake-4.1pl1-win32.zip
-(This is a fixed version of original dmake sources obtained from
+(This is a fixed version of the original dmake sources obtained from
http://www.wticorp.com/dmake/. As of version 4.1PL1, the original
-sources did not build as shipped, and had various other problems.
+sources did not build as shipped and had various other problems.
A patch is included in the above fixed version.)
Fetch and install dmake somewhere on your path (follow the instructions
@@ -97,20 +97,20 @@ build usually works in this circumstance, but some tests will fail.
=item Borland C++
If you are using the Borland compiler, you will need dmake.
-(The make that Borland supplies is seriously crippled, and will not
+(The make that Borland supplies is seriously crippled and will not
work for MakeMaker builds.)
-See L/"Make"> above.
+See L</"Make"> above.
=item Microsoft Visual C++
The nmake that comes with Visual C++ will suffice for building.
-You will need to run the VCVARS32.BAT file usually found somewhere
+You will need to run the VCVARS32.BAT file, usually found somewhere
like C:\MSDEV4.2\BIN. This will set your build environment.
-You can also use dmake to build using Visual C++, provided:
+You can also use dmake to build using Visual C++; provided, however,
you set OSRELEASE to "microsft" (or whatever the directory name
-under which the Visual C dmake configuration lives) in your environment,
+under which the Visual C dmake configuration lives) in your environment
and edit win32/config.vc to change "make=nmake" into "make=dmake". The
latter step is only essential if you want to use dmake as your default
make for building extensions using MakeMaker.
@@ -125,7 +125,7 @@ The GCC-2.95.2 bundle comes with Mingw32 libraries and headers.
Make sure you install the binaries that work with MSVCRT.DLL as indicated
in the README for the GCC bundle. You may need to set up a few environment
-variables (usually run from a batch file).
+variables (usually ran from a batch file).
The version of gcc-2.95.2-msvcrt.exe released 7 November 1999 left out
a fix for certain command line quotes, so be sure to download and install
@@ -149,12 +149,12 @@ makefile are setup to build using the GCC compiler.
=item *
-Edit the makefile.mk (or Makefile, if using nmake) and change the values
-of INST_DRV and INST_TOP. You can also enable various build
-flags. These are explained in the makefiles.
+Edit the makefile.mk (or Makefile, if you're using nmake) and change
+the values of INST_DRV and INST_TOP. You can also enable various
+build flags. These are explained in the makefiles.
-You will have to make sure CCTYPE is set correctly, and CCHOME points
-to wherever you installed your compiler.
+You will have to make sure that CCTYPE is set correctly and that
+CCHOME points to wherever you installed your compiler.
The default value for CCHOME in the makefiles for Visual C++
may not be correct for some versions. Make sure the default exists
@@ -165,7 +165,7 @@ enable the appropriate option in the makefile. des_fcrypt() is not
bundled with the distribution due to US Government restrictions
on the export of cryptographic software. Nevertheless, this routine
is part of the "libdes" library (written by Eric Young) which is widely
-available worldwide, usually along with SSLeay (for example:
+available worldwide, usually along with SSLeay (for example,
"ftp://fractal.mta.ca/pub/crypto/SSLeay/DES/"). Set CRYPT_SRC to the
name of the file that implements des_fcrypt(). Alternatively, if
you have built a library that contains des_fcrypt(), you can set
@@ -212,7 +212,7 @@ If you're using the Borland compiler, you may see a failure in op/taint.t
arising from the inability to find the Borland Runtime DLLs on the system
default path. You will need to copy the DLLs reported by the messages
from where Borland chose to install it, into the Windows system directory
-(usually somewhere like C:\WINNT\SYSTEM32), and rerun the test.
+(usually somewhere like C:\WINNT\SYSTEM32) and rerun the test.
Please report any other failures as described under L<BUGS AND CAVEATS>.
@@ -224,7 +224,7 @@ Makefile. It will also install the pod documentation under
C<$INST_TOP\$VERSION\lib\pod> and HTML versions of the same under
C<$INST_TOP\$VERSION\lib\pod\html>. To use the Perl you just installed,
you will need to add two components to your PATH environment variable,
-C<$INST_TOP\$VERSION\bin>, and C<$INST_TOP\$VERSION\bin\$ARCHNAME>.
+C<$INST_TOP\$VERSION\bin> and C<$INST_TOP\$VERSION\bin\$ARCHNAME>.
For example:
set PATH c:\perl\5.6.0\bin;c:\perl\5.6.0\bin\MSWin32-x86;%PATH%
@@ -301,24 +301,28 @@ runtime do any wildcard expansions of command-line arguments (so
wildcards need not be quoted). Also, the quoting behaviours of the
shell and the C runtime are rudimentary at best (and may, if you are
using a non-standard shell, be inconsistent). The only (useful) quote
-character is the double quote ("). It can be used to protect spaces in
-arguments and other special characters. The Windows NT documentation
-has almost no description of how the quoting rules are implemented, but
-here are some general observations based on experiments: The C runtime
-breaks arguments at spaces and passes them to programs in argc/argv.
-Doublequotes can be used to prevent arguments with spaces in them from
-being split up. You can put a double quote in an argument by escaping
-it with a backslash and enclosing the whole argument within double
-quotes. The backslash and the pair of double quotes surrounding the
-argument will be stripped by the C runtime.
+character is the double quote ("). It can be used to protect spaces
+and other special characters in arguments.
+
+The Windows NT documentation has almost no description of how the
+quoting rules are implemented, but here are some general observations
+based on experiments: The C runtime breaks arguments at spaces and
+passes them to programs in argc/argv. Double quotes can be used to
+prevent arguments with spaces in them from being split up. You can
+put a double quote in an argument by escaping it with a backslash and
+enclosing the whole argument within double quotes. The backslash and
+the pair of double quotes surrounding the argument will be stripped by
+the C runtime.
The file redirection characters "<", ">", and "|" can be quoted by
double quotes (although there are suggestions that this may not always
-be true). Single quotes are not treated as quotes by the shell or the C
-runtime. The caret "^" has also been observed to behave as a quoting
-character, but this appears to be a shell feature, and the caret is not
-stripped from the command line, so Perl still sees it (and the C runtime
-phase does not treat the caret as a quote character).
+be true). Single quotes are not treated as quotes by the shell or
+the C runtime, they don't get stripped by the shell (just to make
+this type of quoting completely useless). The caret "^" has also
+been observed to behave as a quoting character, but this appears
+to be a shell feature, and the caret is not stripped from the command
+line, so Perl still sees it (and the C runtime phase does not treat
+the caret as a quote character).
Here are some examples of usage of the "cmd" shell:
@@ -386,12 +390,12 @@ be built, tested and installed with the standard mantra:
where $MAKE is whatever 'make' program you have configured perl to
use. Use "perl -V:make" to find out what this is. Some extensions
-may not provide a testsuite (so "$MAKE test" may not do anything, or
+may not provide a testsuite (so "$MAKE test" may not do anything or
fail), but most serious ones do.
It is important that you use a supported 'make' program, and
ensure Config.pm knows about it. If you don't have nmake, you can
-either get dmake from the location mentioned earlier, or get an
+either get dmake from the location mentioned earlier or get an
old version of nmake reportedly available from:
ftp://ftp.microsoft.com/Softlib/MSLFILES/nmake15.exe
@@ -439,11 +443,11 @@ be a source of frustration if you use such a perl binary with an
alternate shell that *does* expand wildcards.
Instead, the following solution works rather well. The nice things
-about it: 1) you can start using it right away 2) it is more powerful,
-because it will do the right thing with a pattern like */*/*.c
-3) you can decide whether you do/don't want to use it 4) you can
-extend the method to add any customizations (or even entirely
-different kinds of wildcard expansion).
+about it are 1) you can start using it right away; 2) it is more
+powerful, because it will do the right thing with a pattern like
+*/*/*.c; 3) you can decide whether you do/don't want to use it; and
+4) you can extend the method to add any customizations (or even
+entirely different kinds of wildcard expansion).
C:\> copy con c:\perl\lib\Wild.pm
# Wild.pm - emulate shell @ARGV expansion on shells that don't
@@ -485,7 +489,7 @@ from CPAN. You may find that many of these extensions are meant to
be used under the Activeware port of Perl, which used to be the only
native port for the Win32 platform. Since the Activeware port does not
have adequate support for Perl's extension building tools, these
-extensions typically do not support those tools either, and therefore
+extensions typically do not support those tools either and, therefore,
cannot be built using the generic steps shown in the previous section.
To ensure smooth transitioning of existing code that uses the
@@ -541,7 +545,7 @@ If you use the 4DOS/NT or similar command shell, note that
refer to all the command line arguments, so you may need to make
sure that construct works in batch files. As of this writing,
4DOS/NT users will need a "ParameterChar = *" statement in their
-4NT.INI file, or will need to execute "setdos /p*" in the 4DOS/NT
+4NT.INI file or will need to execute "setdos /p*" in the 4DOS/NT
startup file to enable this to work.
=item 3
@@ -595,7 +599,7 @@ Some of the built-in functions do not act exactly as documented in
L<perlfunc>, and a few are not implemented at all. To avoid
surprises, particularly if you have had prior exposure to Perl
in other operating environments or if you intend to write code
-that will be portable to other environments, see L<perlport>
+that will be portable to other environments. See L<perlport>
for a reasonably definitive list of these differences.
Not all extensions available from CPAN may build or work properly
diff --git a/patchlevel.h b/patchlevel.h
index 8ed6f5386c..70cadf9f11 100644
--- a/patchlevel.h
+++ b/patchlevel.h
@@ -70,7 +70,7 @@
#if !defined(PERL_PATCHLEVEL_H_IMPLICIT) && !defined(LOCAL_PATCH_COUNT)
static char *local_patches[] = {
NULL
- ,"DEVEL7706"
+ ,"DEVEL7733"
,NULL
};
diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod
index 2049dd57a2..ec0fe0880f 100644
--- a/pod/perlfunc.pod
+++ b/pod/perlfunc.pod
@@ -2483,6 +2483,29 @@ Using a regular C<foreach> loop for this purpose would be clearer in
most cases. See also L</grep> for an array composed of those items of
the original list for which the BLOCK or EXPR evaluates to true.
+C<{> starts both hash references and blocks, so C<map { ...> could be either
+the start of map BLOCK LIST or map EXPR, LIST. Because perl doesn't look
+ahead for the closing C<}> it has to take a guess at which its dealing with
+based what it finds just after the C<{>. Usually it gets it right, but if it
+doesn't it won't realize something is wrong until it gets to the C<}> and
+encounters the missing (or unexpected) comma. The syntax error will be
+reported close to the C<}> but you'll need to change something near the C<{>
+such as using a unary C<+> to give perl some help:
+
+ %hash = map { "\L$_", 1 } @array # perl guesses EXPR. wrong
+ %hash = map { +"\L$_", 1 } @array # perl guesses BLOCK. right
+ %hash = map { ("\L$_", 1) } @array # this also works
+ %hash = map { lc($_), 1 } @array # as does this.
+ %hash = map +( lc($_), 1 ), @array # this is EXPR and works!
+
+ %hash = map ( lc($_), 1 ), @array # evaluates to (1, @array)
+
+or to force an anon hash constructor use C<+{>
+
+ @hashes = map +{ lc($_), 1 }, @array # EXPR, so needs , at end
+
+and you get list of anonymous hashes each with only 1 entry.
+
=item mkdir FILENAME,MASK
=item mkdir FILENAME
diff --git a/pp.c b/pp.c
index 40a3970cbb..59c67e9957 100644
--- a/pp.c
+++ b/pp.c
@@ -3936,7 +3936,6 @@ PP(pp_unpack)
if (checksum) {
#if LONGSIZE != SIZE32
if (natint) {
- long along;
while (len-- > 0) {
COPYNN(s, &along, sizeof(long));
s += sizeof(long);
@@ -3950,6 +3949,9 @@ PP(pp_unpack)
#endif
{
while (len-- > 0) {
+#if LONGSIZE > SIZE32 && INTSIZE == SIZE32
+ I32 along;
+#endif
COPY32(s, &along);
#if LONGSIZE > SIZE32
if (along > 2147483647)
@@ -3968,7 +3970,6 @@ PP(pp_unpack)
EXTEND_MORTAL(len);
#if LONGSIZE != SIZE32
if (natint) {
- long along;
while (len-- > 0) {
COPYNN(s, &along, sizeof(long));
s += sizeof(long);
@@ -3981,6 +3982,9 @@ PP(pp_unpack)
#endif
{
while (len-- > 0) {
+#if LONGSIZE > SIZE32 && INTSIZE == SIZE32
+ I32 along;
+#endif
COPY32(s, &along);
#if LONGSIZE > SIZE32
if (along > 2147483647)
diff --git a/regcomp.c b/regcomp.c
index 19b8096833..6471b8d0ba 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -151,6 +151,7 @@ typedef struct scan_data_t {
I32 offset_float_max;
I32 flags;
I32 whilem_c;
+ I32 *last_closep;
struct regnode_charclass_class *start_class;
} scan_data_t;
@@ -159,7 +160,7 @@ typedef struct scan_data_t {
*/
static scan_data_t zero_scan_data = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0 };
+ 0, 0, 0, 0, 0, 0};
#define SF_BEFORE_EOL (SF_BEFORE_SEOL|SF_BEFORE_MEOL)
#define SF_BEFORE_SEOL 0x1
@@ -665,13 +666,17 @@ S_study_chunk(pTHX_ regnode **scanp, I32 *deltap, regnode *last, scan_data_t *da
if (flags & SCF_DO_STCLASS)
cl_init_zero(&accum);
while (OP(scan) == code) {
- I32 deltanext, minnext, f = 0;
+ I32 deltanext, minnext, f = 0, fake = 0;
struct regnode_charclass_class this_class;
num++;
data_fake.flags = 0;
- if (data)
+ if (data) {
data_fake.whilem_c = data->whilem_c;
+ data_fake.last_closep = data->last_closep;
+ }
+ else
+ data_fake.last_closep = &fake;
next = regnext(scan);
scan = NEXTOPER(scan);
if (code != BRANCH)
@@ -887,6 +892,11 @@ S_study_chunk(pTHX_ regnode **scanp, I32 *deltap, regnode *last, scan_data_t *da
mincount = ARG1(scan);
maxcount = ARG2(scan);
next = regnext(scan);
+ if (OP(scan) == CURLYX) {
+ I32 lp = (data ? *(data->last_closep) : 0);
+
+ scan->flags = ((lp <= U8_MAX) ? lp : U8_MAX);
+ }
scan = NEXTOPER(scan) + EXTRA_STEP_2ARGS;
do_curly:
if (flags & SCF_DO_SUBSTR) {
@@ -1356,14 +1366,18 @@ S_study_chunk(pTHX_ regnode **scanp, I32 *deltap, regnode *last, scan_data_t *da
&& (scan->flags || data || (flags & SCF_DO_STCLASS))
&& (OP(scan) == IFMATCH || OP(scan) == UNLESSM)) {
/* Lookahead/lookbehind */
- I32 deltanext, minnext;
+ I32 deltanext, minnext, fake = 0;
regnode *nscan;
struct regnode_charclass_class intrnl;
int f = 0;
data_fake.flags = 0;
- if (data)
+ if (data) {
data_fake.whilem_c = data->whilem_c;
+ data_fake.last_closep = data->last_closep;
+ }
+ else
+ data_fake.last_closep = &fake;
if ( flags & SCF_DO_STCLASS && !scan->flags
&& OP(scan) == IFMATCH ) { /* Lookahead */
cl_init(&intrnl);
@@ -1399,11 +1413,15 @@ S_study_chunk(pTHX_ regnode **scanp, I32 *deltap, regnode *last, scan_data_t *da
else if (OP(scan) == OPEN) {
pars++;
}
- else if (OP(scan) == CLOSE && ARG(scan) == is_par) {
- next = regnext(scan);
+ else if (OP(scan) == CLOSE) {
+ if (ARG(scan) == is_par) {
+ next = regnext(scan);
- if ( next && (OP(next) != WHILEM) && next < last)
- is_par = 0; /* Disable optimization */
+ if ( next && (OP(next) != WHILEM) && next < last)
+ is_par = 0; /* Disable optimization */
+ }
+ if (data)
+ *(data->last_closep) = ARG(scan);
}
else if (OP(scan) == EVAL) {
if (data)
@@ -1625,6 +1643,7 @@ Perl_pregcomp(pTHX_ char *exp, char *xend, PMOP *pm)
STRLEN longest_float_length, longest_fixed_length;
struct regnode_charclass_class ch_class;
int stclass_flag;
+ I32 last_close = 0;
first = scan;
/* Skip introductions and multiplicators >= 1. */
@@ -1717,6 +1736,7 @@ Perl_pregcomp(pTHX_ char *exp, char *xend, PMOP *pm)
stclass_flag = SCF_DO_STCLASS_AND;
} else /* XXXX Check for BOUND? */
stclass_flag = 0;
+ data.last_closep = &last_close;
minlen = study_chunk(&first, &fake, scan + PL_regsize, /* Up to end */
&data, SCF_DO_SUBSTR | stclass_flag);
@@ -1821,11 +1841,13 @@ Perl_pregcomp(pTHX_ char *exp, char *xend, PMOP *pm)
/* Several toplevels. Best we can is to set minlen. */
I32 fake;
struct regnode_charclass_class ch_class;
+ I32 last_close = 0;
DEBUG_r(PerlIO_printf(Perl_debug_log, "\n"));
scan = r->program + 1;
cl_init(&ch_class);
data.start_class = &ch_class;
+ data.last_closep = &last_close;
minlen = study_chunk(&scan, &fake, scan + PL_regsize, &data, SCF_DO_STCLASS_AND);
r->check_substr = r->anchored_substr = r->float_substr = Nullsv;
if (!(data.start_class->flags & ANYOF_EOS)
@@ -4233,7 +4255,7 @@ Perl_regprop(pTHX_ SV *sv, regnode *o)
Perl_sv_catpvf(aTHX_ sv, " <%s%.*s%s>", PL_colors[0],
STR_LEN(o), STRING(o), PL_colors[1]);
else if (k == CURLY) {
- if (OP(o) == CURLYM || OP(o) == CURLYN)
+ if (OP(o) == CURLYM || OP(o) == CURLYN || OP(o) == CURLYX)
Perl_sv_catpvf(aTHX_ sv, "[%d]", o->flags); /* Parenth number */
Perl_sv_catpvf(aTHX_ sv, " {%d,%d}", ARG1(o), ARG2(o));
}
diff --git a/regexec.c b/regexec.c
index a71f1d8601..c0d0097fa4 100644
--- a/regexec.c
+++ b/regexec.c
@@ -2596,12 +2596,18 @@ S_regmatch(pTHX_ regnode *prog)
case CURLYX: {
CURCUR cc;
CHECKPOINT cp = PL_savestack_ix;
+ /* No need to save/restore up to this paren */
+ I32 parenfloor = scan->flags;
if (OP(PREVOPER(next)) == NOTHING) /* LONGJMP */
next += ARG(next);
cc.oldcc = PL_regcc;
PL_regcc = &cc;
- cc.parenfloor = *PL_reglastparen;
+ /* XXXX Probably it is better to teach regpush to support
+ parenfloor > PL_regsize... */
+ if (parenfloor > *PL_reglastparen)
+ parenfloor = *PL_reglastparen; /* Pessimization... */
+ cc.parenfloor = parenfloor;
cc.cur = -1;
cc.min = ARG1(scan);
cc.max = ARG2(scan);
diff --git a/t/op/re_tests b/t/op/re_tests
index c2753e592e..102157c842 100644
--- a/t/op/re_tests
+++ b/t/op/re_tests
@@ -775,3 +775,7 @@ tt+$ xxxtt y - -
'^.{9}abc.*\n'm 123\nabcabcabcabc\n y - -
^(a)?a$ a y -$1- --
^(a)?(?(1)a|b)+$ a n - -
+^(a\1?)(a\1?)(a\2?)(a\3?)$ aaaaaa y $1,$2,$3,$4 a,aa,a,aa
+^(a\1?){4}$ aaaaaa y $1 aa
+^(0+)?(?:x(1))? x1 y - -
+^([0-9a-fA-F]+)(?:x([0-9a-fA-F]+)?)(?:x([0-9a-fA-F]+))? 012cxx0190 y - -