Compare commits
No commits in common. "stream-perl-5.30-rhel-8.10.0" and "c8" have entirely different histories.
stream-per
...
c8
|
@ -1,34 +1 @@
|
||||||
perl-5.12.1.tar.gz
|
SOURCES/perl-5.26.3.tar.bz2
|
||||||
/perl-5.12.2.tar.gz
|
|
||||||
/perl-5.12.3.tar.gz
|
|
||||||
/perl-5.14.0-RC2.tar.bz2
|
|
||||||
/perl-5.14.0.tar.bz2
|
|
||||||
/perl-5.14.0.tar.gz
|
|
||||||
/perl-5.14.1.tar.gz
|
|
||||||
/perl-5.14.2.tar.bz2
|
|
||||||
/perl-5.16.0-RC2.tar.gz
|
|
||||||
/perl-5.16.0.tar.gz
|
|
||||||
/perl-5.16.1-228.fc19.src.rpm
|
|
||||||
/perl-5.16.1.tar.gz
|
|
||||||
/perl-5.16.2.tar.gz
|
|
||||||
/perl-5.16.3.tar.bz2
|
|
||||||
/perl-5.18.0.tar.bz2
|
|
||||||
/perl-5.18.1.tar.bz2
|
|
||||||
/perl-5.18.2.tar.bz2
|
|
||||||
/perl-5.20.0.tar.bz2
|
|
||||||
/perl-5.20.1.tar.bz2
|
|
||||||
/perl-5.20.2.tar.bz2
|
|
||||||
/perl-5.22.0.tar.bz2
|
|
||||||
/perl-5.22.1.tar.bz2
|
|
||||||
/perl-5.22.2.tar.bz2
|
|
||||||
/perl-5.24.0.tar.bz2
|
|
||||||
/perl-5.24.1.tar.bz2
|
|
||||||
/perl-5.26.0.tar.bz2
|
|
||||||
/perl-5.26.1.tar.bz2
|
|
||||||
/perl-5.26.2-RC1.tar.bz2
|
|
||||||
/perl-5.26.2.tar.bz2
|
|
||||||
/perl-5.28.0.tar.xz
|
|
||||||
/perl-5.28.1.tar.xz
|
|
||||||
/perl-5.28.2.tar.xz
|
|
||||||
/perl-5.30.0.tar.xz
|
|
||||||
/perl-5.30.1.tar.xz
|
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
4bc190b6ac368f573e6a028f91430f831d40d30a perl-5.30.1.tar.xz
|
4c61872bab631427cbb5b519ef8809d3a4c7f921 SOURCES/perl-5.26.3.tar.bz2
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -22,13 +22,6 @@ export PERL_AUTOINSTALL="--defaultdeps"
|
||||||
export PERL_MM_USE_DEFAULT=1
|
export PERL_MM_USE_DEFAULT=1
|
||||||
}
|
}
|
||||||
|
|
||||||
#############################################################################
|
|
||||||
# Perl specific macros, no longer part of rpm >= 4.15
|
|
||||||
%perl_vendorarch %(eval "`%{__perl} -V:installvendorarch`"; echo $installvendorarch)
|
|
||||||
%perl_vendorlib %(eval "`%{__perl} -V:installvendorlib`"; echo $installvendorlib)
|
|
||||||
%perl_archlib %(eval "`%{__perl} -V:installarchlib`"; echo $installarchlib)
|
|
||||||
%perl_privlib %(eval "`%{__perl} -V:installprivlib`"; echo $installprivlib)
|
|
||||||
|
|
||||||
#############################################################################
|
#############################################################################
|
||||||
# Filtering macro incantations
|
# Filtering macro incantations
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
diff -up perl-5.10.0/Configure.didi perl-5.10.0/Configure
|
diff -up perl-5.10.0/Configure.didi perl-5.10.0/Configure
|
||||||
--- perl-5.10.0/Configure.didi 2007-12-18 11:47:07.000000000 +0100
|
--- perl-5.10.0/Configure.didi 2007-12-18 11:47:07.000000000 +0100
|
||||||
+++ perl-5.10.0/Configure 2008-07-21 10:51:16.000000000 +0200
|
+++ perl-5.10.0/Configure 2008-07-21 10:51:16.000000000 +0200
|
||||||
@@ -1483,7 +1483,7 @@ archname=''
|
@@ -1479,7 +1479,7 @@ archname=''
|
||||||
usereentrant='undef'
|
usereentrant='undef'
|
||||||
: List of libraries we want.
|
: List of libraries we want.
|
||||||
: If anyone needs extra -lxxx, put those in a hint file.
|
: If anyone needs extra -lxxx, put those in a hint file.
|
|
@ -1,12 +1,12 @@
|
||||||
diff -up perl-5.10.0/t/io/fs.t.BAD perl-5.10.0/t/io/fs.t
|
diff -up perl-5.10.0/t/io/fs.t.BAD perl-5.10.0/t/io/fs.t
|
||||||
--- perl-5.10.0/t/io/fs.t.BAD 2008-01-30 13:36:43.000000000 -0500
|
--- perl-5.10.0/t/io/fs.t.BAD 2008-01-30 13:36:43.000000000 -0500
|
||||||
+++ perl-5.10.0/t/io/fs.t 2008-01-30 13:41:27.000000000 -0500
|
+++ perl-5.10.0/t/io/fs.t 2008-01-30 13:41:27.000000000 -0500
|
||||||
@@ -257,7 +257,7 @@ isnt($atime, 500000000, 'atime');
|
@@ -227,7 +227,7 @@ isnt($atime, 500000000, 'atime');
|
||||||
isnt($mtime, $ut + $delta, 'mtime: utime called with two undefs');
|
isnt($mtime, 500000000 + $delta, 'mtime');
|
||||||
|
|
||||||
SKIP: {
|
SKIP: {
|
||||||
- skip "no futimes", 6 unless ($Config{d_futimes} || "") eq "define";
|
- skip "no futimes", 6 unless ($Config{d_futimes} || "") eq "define";
|
||||||
+ skip "no futimes", 6;
|
+ skip "no futimes", 6;
|
||||||
note("check futimes");
|
|
||||||
open(my $fh, "<", 'b');
|
open(my $fh, "<", 'b');
|
||||||
$foo = (utime $ut,$ut + $delta, $fh);
|
$foo = (utime 500000000,500000000 + $delta, $fh);
|
||||||
|
is($foo, 1, "futime");
|
|
@ -20,7 +20,7 @@ diff --git a/MANIFEST b/MANIFEST
|
||||||
index 397252a..d7c519b 100644
|
index 397252a..d7c519b 100644
|
||||||
--- a/MANIFEST
|
--- a/MANIFEST
|
||||||
+++ b/MANIFEST
|
+++ b/MANIFEST
|
||||||
@@ -3424,6 +3424,7 @@ dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/aix.pm CBuilder methods fo
|
@@ -3093,6 +3093,7 @@ dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/aix.pm CBuilder methods fo
|
||||||
dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/cygwin.pm CBuilder methods for cygwin
|
dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/cygwin.pm CBuilder methods for cygwin
|
||||||
dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/darwin.pm CBuilder methods for darwin
|
dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/darwin.pm CBuilder methods for darwin
|
||||||
dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/dec_osf.pm CBuilder methods for OSF
|
dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/dec_osf.pm CBuilder methods for OSF
|
|
@ -18,7 +18,7 @@ diff --git a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm b/cpan/ExtUtils-Mak
|
||||||
index a8b172f..a3fbce2 100644
|
index a8b172f..a3fbce2 100644
|
||||||
--- a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
|
--- a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
|
||||||
+++ b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
|
+++ b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
|
||||||
@@ -30,6 +30,7 @@ BEGIN {
|
@@ -31,6 +31,7 @@ BEGIN {
|
||||||
$Is{IRIX} = $^O eq 'irix';
|
$Is{IRIX} = $^O eq 'irix';
|
||||||
$Is{NetBSD} = $^O eq 'netbsd';
|
$Is{NetBSD} = $^O eq 'netbsd';
|
||||||
$Is{Interix} = $^O eq 'interix';
|
$Is{Interix} = $^O eq 'interix';
|
||||||
|
@ -26,7 +26,7 @@ index a8b172f..a3fbce2 100644
|
||||||
$Is{SunOS4} = $^O eq 'sunos';
|
$Is{SunOS4} = $^O eq 'sunos';
|
||||||
$Is{Solaris} = $^O eq 'solaris';
|
$Is{Solaris} = $^O eq 'solaris';
|
||||||
$Is{SunOS} = $Is{SunOS4} || $Is{Solaris};
|
$Is{SunOS} = $Is{SunOS4} || $Is{Solaris};
|
||||||
@@ -1028,7 +1029,7 @@ sub xs_make_dynamic_lib {
|
@@ -932,7 +933,7 @@ $(INST_DYNAMIC): $(OBJECT) $(MYEXTLIB) $(BOOTSTRAP) $(INST_ARCHAUTODIR)$(DFSEP).
|
||||||
push(@m," \$(RM_F) \$\@\n");
|
push(@m," \$(RM_F) \$\@\n");
|
||||||
|
|
||||||
my $libs = '$(LDLOADLIBS)';
|
my $libs = '$(LDLOADLIBS)';
|
||||||
|
@ -35,7 +35,7 @@ index a8b172f..a3fbce2 100644
|
||||||
# Use nothing on static perl platforms, and to the flags needed
|
# Use nothing on static perl platforms, and to the flags needed
|
||||||
# to link against the shared libperl library on shared perl
|
# to link against the shared libperl library on shared perl
|
||||||
# platforms. We peek at lddlflags to see if we need -Wl,-R
|
# platforms. We peek at lddlflags to see if we need -Wl,-R
|
||||||
@@ -1041,6 +1042,11 @@ sub xs_make_dynamic_lib {
|
@@ -941,6 +942,11 @@ $(INST_DYNAMIC): $(OBJECT) $(MYEXTLIB) $(BOOTSTRAP) $(INST_ARCHAUTODIR)$(DFSEP).
|
||||||
# The Android linker will not recognize symbols from
|
# The Android linker will not recognize symbols from
|
||||||
# libperl unless the module explicitly depends on it.
|
# libperl unless the module explicitly depends on it.
|
||||||
$libs .= ' "-L$(PERL_INC)" -lperl';
|
$libs .= ' "-L$(PERL_INC)" -lperl';
|
|
@ -14,21 +14,16 @@ diff --git a/Makefile.SH b/Makefile.SH
|
||||||
index d1da0a0..7733a32 100755
|
index d1da0a0..7733a32 100755
|
||||||
--- a/Makefile.SH
|
--- a/Makefile.SH
|
||||||
+++ b/Makefile.SH
|
+++ b/Makefile.SH
|
||||||
@@ -70,11 +70,11 @@ true)
|
@@ -58,7 +58,7 @@ true)
|
||||||
${revision}.${patchlevel}.${subversion}"
|
${api_revision}.${api_version}.${api_subversion} \
|
||||||
case "$osvers" in
|
-current_version \
|
||||||
1[5-9]*|[2-9]*)
|
${revision}.${patchlevel}.${subversion} \
|
||||||
- shrpldflags="$shrpldflags -install_name `pwd`/\$@ -Xlinker -headerpad_max_install_names"
|
- -install_name \$(shrpdir)/\$@"
|
||||||
+ shrpldflags="$shrpldflags -install_name `pwd`/libperl.${revision}.${patchlevel}.dylib -Xlinker -headerpad_max_install_names"
|
+ -install_name \$(shrpdir)/libperl.${revision}.${patchlevel}.dylib"
|
||||||
exeldflags="-Xlinker -headerpad_max_install_names"
|
|
||||||
;;
|
;;
|
||||||
*)
|
cygwin*)
|
||||||
- shrpldflags="$shrpldflags -install_name \$(shrpdir)/\$@"
|
shrpldflags="$shrpldflags -Wl,--out-implib=libperl.dll.a -Wl,--image-base,0x52000000"
|
||||||
+ shrpldflags="$shrpldflags -install_name \$(shrpdir)/libperl.${revision}.${patchlevel}.dylib"
|
@@ -66,13 +66,15 @@ true)
|
||||||
;;
|
|
||||||
esac
|
|
||||||
;;
|
|
||||||
@@ -76,13 +76,15 @@ true)
|
|
||||||
;;
|
;;
|
||||||
sunos*)
|
sunos*)
|
||||||
linklibperl="-lperl"
|
linklibperl="-lperl"
|
||||||
|
@ -45,7 +40,7 @@ index d1da0a0..7733a32 100755
|
||||||
;;
|
;;
|
||||||
aix*)
|
aix*)
|
||||||
case "$cc" in
|
case "$cc" in
|
||||||
@@ -120,6 +122,9 @@ true)
|
@@ -110,6 +112,9 @@ true)
|
||||||
linklibperl='libperl.x'
|
linklibperl='libperl.x'
|
||||||
DPERL_EXTERNAL_GLOB=''
|
DPERL_EXTERNAL_GLOB=''
|
||||||
;;
|
;;
|
|
@ -0,0 +1,30 @@
|
||||||
|
From 862c89c81d26dae0dcef138e19df8b45615e69c9 Mon Sep 17 00:00:00 2001
|
||||||
|
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
|
||||||
|
Date: Mon, 2 Dec 2013 10:10:56 +0100
|
||||||
|
Subject: [PATCH] Document Math::BigInt::CalcEmu requires Math::BigInt
|
||||||
|
MIME-Version: 1.0
|
||||||
|
Content-Type: text/plain; charset=UTF-8
|
||||||
|
Content-Transfer-Encoding: 8bit
|
||||||
|
|
||||||
|
<https://rt.cpan.org/Public/Bug/Display.html?id=85015>
|
||||||
|
|
||||||
|
Signed-off-by: Petr Písař <ppisar@redhat.com>
|
||||||
|
---
|
||||||
|
dist/Math-BigInt/lib/Math/BigInt/CalcEmu.pm | 1 +
|
||||||
|
1 file changed, 1 insertion(+)
|
||||||
|
|
||||||
|
diff --git a/dist/Math-BigInt/lib/Math/BigInt/CalcEmu.pm b/dist/Math-BigInt/lib/Math/BigInt/CalcEmu.pm
|
||||||
|
index c82e153..0c0b496 100644
|
||||||
|
--- a/cpan/Math-BigInt/lib/Math/BigInt/CalcEmu.pm
|
||||||
|
+++ b/cpan/Math-BigInt/lib/Math/BigInt/CalcEmu.pm
|
||||||
|
@@ -290,6 +290,7 @@ Math::BigInt::CalcEmu - Emulate low-level math with BigInt code
|
||||||
|
|
||||||
|
=head1 SYNOPSIS
|
||||||
|
|
||||||
|
+ use Math::BigInt;
|
||||||
|
use Math::BigInt::CalcEmu;
|
||||||
|
|
||||||
|
=head1 DESCRIPTION
|
||||||
|
--
|
||||||
|
1.8.3.1
|
||||||
|
|
|
@ -41,15 +41,15 @@ index 33e08e2..7160f54 100644
|
||||||
GDBM_FILE dbp ;
|
GDBM_FILE dbp ;
|
||||||
SV * filter[4];
|
SV * filter[4];
|
||||||
int filtering ;
|
int filtering ;
|
||||||
@@ -98,6 +99,7 @@ gdbm_TIEHASH(dbtype, name, read_write, m
|
@@ -89,6 +90,7 @@ gdbm_TIEHASH(dbtype, name, read_write, mode)
|
||||||
}
|
if ((dbp = gdbm_open(name, GDBM_BLOCKSIZE, read_write, mode,
|
||||||
if (dbp) {
|
(FATALFUNC) croak_string))) {
|
||||||
RETVAL = (GDBM_File)safecalloc(1, sizeof(GDBM_File_type)) ;
|
RETVAL = (GDBM_File)safecalloc(1, sizeof(GDBM_File_type)) ;
|
||||||
+ RETVAL->owner = aTHX;
|
+ RETVAL->owner = aTHX;
|
||||||
RETVAL->dbp = dbp ;
|
RETVAL->dbp = dbp ;
|
||||||
} else {
|
}
|
||||||
RETVAL = NULL;
|
|
||||||
@@ -118,12 +120,14 @@ gdbm_DESTROY(db)
|
@@ -109,12 +111,14 @@ gdbm_DESTROY(db)
|
||||||
PREINIT:
|
PREINIT:
|
||||||
int i = store_value;
|
int i = store_value;
|
||||||
CODE:
|
CODE:
|
||||||
|
@ -115,7 +115,7 @@ diff --git a/ext/ODBM_File/ODBM_File.xs b/ext/ODBM_File/ODBM_File.xs
|
||||||
index d1ece7f..f7e00a0 100644
|
index d1ece7f..f7e00a0 100644
|
||||||
--- a/ext/ODBM_File/ODBM_File.xs
|
--- a/ext/ODBM_File/ODBM_File.xs
|
||||||
+++ b/ext/ODBM_File/ODBM_File.xs
|
+++ b/ext/ODBM_File/ODBM_File.xs
|
||||||
@@ -49,6 +49,7 @@ datum nextkey(datum key);
|
@@ -45,6 +45,7 @@ datum nextkey(datum key);
|
||||||
#define store_value 3
|
#define store_value 3
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
@ -123,7 +123,7 @@ index d1ece7f..f7e00a0 100644
|
||||||
void * dbp ;
|
void * dbp ;
|
||||||
SV * filter[4];
|
SV * filter[4];
|
||||||
int filtering ;
|
int filtering ;
|
||||||
@@ -137,6 +138,7 @@ odbm_TIEHASH(dbtype, filename, flags, mode)
|
@@ -112,6 +113,7 @@ odbm_TIEHASH(dbtype, filename, flags, mode)
|
||||||
}
|
}
|
||||||
dbp = (void*)(dbminit(filename) >= 0 ? &dbmrefcnt : 0);
|
dbp = (void*)(dbminit(filename) >= 0 ? &dbmrefcnt : 0);
|
||||||
RETVAL = (ODBM_File)safecalloc(1, sizeof(ODBM_File_type));
|
RETVAL = (ODBM_File)safecalloc(1, sizeof(ODBM_File_type));
|
||||||
|
@ -131,7 +131,7 @@ index d1ece7f..f7e00a0 100644
|
||||||
RETVAL->dbp = dbp ;
|
RETVAL->dbp = dbp ;
|
||||||
}
|
}
|
||||||
OUTPUT:
|
OUTPUT:
|
||||||
@@ -149,13 +151,15 @@ DESTROY(db)
|
@@ -124,13 +126,15 @@ DESTROY(db)
|
||||||
dMY_CXT;
|
dMY_CXT;
|
||||||
int i = store_value;
|
int i = store_value;
|
||||||
CODE:
|
CODE:
|
||||||
|
@ -166,7 +166,7 @@ index 291e41b..0bdae9a 100644
|
||||||
DBM * dbp ;
|
DBM * dbp ;
|
||||||
SV * filter[4];
|
SV * filter[4];
|
||||||
int filtering ;
|
int filtering ;
|
||||||
@@ -51,6 +52,7 @@ sdbm_TIEHASH(dbtype, filename, flags, mode)
|
@@ -49,6 +50,7 @@ sdbm_TIEHASH(dbtype, filename, flags, mode)
|
||||||
}
|
}
|
||||||
if (dbp) {
|
if (dbp) {
|
||||||
RETVAL = (SDBM_File)safecalloc(1, sizeof(SDBM_File_type));
|
RETVAL = (SDBM_File)safecalloc(1, sizeof(SDBM_File_type));
|
||||||
|
@ -174,7 +174,7 @@ index 291e41b..0bdae9a 100644
|
||||||
RETVAL->dbp = dbp ;
|
RETVAL->dbp = dbp ;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -62,7 +64,7 @@ void
|
@@ -60,7 +62,7 @@ void
|
||||||
sdbm_DESTROY(db)
|
sdbm_DESTROY(db)
|
||||||
SDBM_File db
|
SDBM_File db
|
||||||
CODE:
|
CODE:
|
||||||
|
@ -187,7 +187,7 @@ diff --git a/t/lib/dbmt_common.pl b/t/lib/dbmt_common.pl
|
||||||
index 5d4098c..a0a4d52 100644
|
index 5d4098c..a0a4d52 100644
|
||||||
--- a/t/lib/dbmt_common.pl
|
--- a/t/lib/dbmt_common.pl
|
||||||
+++ b/t/lib/dbmt_common.pl
|
+++ b/t/lib/dbmt_common.pl
|
||||||
@@ -510,5 +510,40 @@ unlink <Op_dbmx*>, $Dfile;
|
@@ -511,5 +511,40 @@ unlink <Op_dbmx*>, $Dfile;
|
||||||
unlink <Op1_dbmx*>;
|
unlink <Op1_dbmx*>;
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,7 +16,7 @@ diff --git a/Configure b/Configure
|
||||||
index 2f30261..825496e 100755
|
index 2f30261..825496e 100755
|
||||||
--- a/Configure
|
--- a/Configure
|
||||||
+++ b/Configure
|
+++ b/Configure
|
||||||
@@ -8762,7 +8762,9 @@ esac
|
@@ -8249,7 +8249,9 @@ esac
|
||||||
|
|
||||||
# Detect old use of shrpdir via undocumented Configure -Dshrpdir
|
# Detect old use of shrpdir via undocumented Configure -Dshrpdir
|
||||||
case "$shrpdir" in
|
case "$shrpdir" in
|
||||||
|
@ -27,7 +27,7 @@ index 2f30261..825496e 100755
|
||||||
*) $cat >&4 <<EOM
|
*) $cat >&4 <<EOM
|
||||||
WARNING: Use of the shrpdir variable for the installation location of
|
WARNING: Use of the shrpdir variable for the installation location of
|
||||||
the shared $libperl is not supported. It was never documented and
|
the shared $libperl is not supported. It was never documented and
|
||||||
@@ -8792,7 +8794,6 @@ esac
|
@@ -8279,7 +8281,6 @@ esac
|
||||||
# Add $xxx to ccdlflags.
|
# Add $xxx to ccdlflags.
|
||||||
# If we can't figure out a command-line option, use $shrpenv to
|
# If we can't figure out a command-line option, use $shrpenv to
|
||||||
# set env LD_RUN_PATH. The main perl makefile uses this.
|
# set env LD_RUN_PATH. The main perl makefile uses this.
|
||||||
|
@ -35,7 +35,7 @@ index 2f30261..825496e 100755
|
||||||
xxx=''
|
xxx=''
|
||||||
tmp_shrpenv=''
|
tmp_shrpenv=''
|
||||||
if "$useshrplib"; then
|
if "$useshrplib"; then
|
||||||
@@ -8807,7 +8808,7 @@ if "$useshrplib"; then
|
@@ -8294,7 +8295,7 @@ if "$useshrplib"; then
|
||||||
xxx="-Wl,-R$shrpdir"
|
xxx="-Wl,-R$shrpdir"
|
||||||
;;
|
;;
|
||||||
bsdos|linux|irix*|dec_osf|gnu*|haiku)
|
bsdos|linux|irix*|dec_osf|gnu*|haiku)
|
||||||
|
@ -48,7 +48,7 @@ diff --git a/Makefile.SH b/Makefile.SH
|
||||||
index 7733a32..a481183 100755
|
index 7733a32..a481183 100755
|
||||||
--- a/Makefile.SH
|
--- a/Makefile.SH
|
||||||
+++ b/Makefile.SH
|
+++ b/Makefile.SH
|
||||||
@@ -288,7 +288,7 @@ ranlib = $ranlib
|
@@ -266,7 +266,7 @@ ranlib = $ranlib
|
||||||
# installman commandline.
|
# installman commandline.
|
||||||
bin = $installbin
|
bin = $installbin
|
||||||
scriptdir = $scriptdir
|
scriptdir = $scriptdir
|
|
@ -23,7 +23,7 @@ diff --git a/MANIFEST b/MANIFEST
|
||||||
index 6af238c..d4f0c56 100644
|
index 6af238c..d4f0c56 100644
|
||||||
--- a/MANIFEST
|
--- a/MANIFEST
|
||||||
+++ b/MANIFEST
|
+++ b/MANIFEST
|
||||||
@@ -784,6 +784,7 @@ cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_OS2.pm MakeMaker methods for OS/2
|
@@ -1045,6 +1045,7 @@ cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_OS2.pm MakeMaker methods for OS/2
|
||||||
cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_OS2.pm MakeMaker methods for OS/2
|
cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_OS2.pm MakeMaker methods for OS/2
|
||||||
cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_QNX.pm MakeMaker methods for QNX
|
cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_QNX.pm MakeMaker methods for QNX
|
||||||
cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm MakeMaker methods for Unix
|
cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm MakeMaker methods for Unix
|
|
@ -20,7 +20,7 @@ diff --git a/cpan/IPC-Cmd/lib/IPC/Cmd.pm b/cpan/IPC-Cmd/lib/IPC/Cmd.pm
|
||||||
index 6a82bdf..b6cd7ef 100644
|
index 6a82bdf..b6cd7ef 100644
|
||||||
--- a/cpan/IPC-Cmd/lib/IPC/Cmd.pm
|
--- a/cpan/IPC-Cmd/lib/IPC/Cmd.pm
|
||||||
+++ b/cpan/IPC-Cmd/lib/IPC/Cmd.pm
|
+++ b/cpan/IPC-Cmd/lib/IPC/Cmd.pm
|
||||||
@@ -232,7 +232,7 @@ sub can_run {
|
@@ -230,7 +230,7 @@ sub can_run {
|
||||||
}
|
}
|
||||||
|
|
||||||
require File::Spec;
|
require File::Spec;
|
|
@ -0,0 +1,73 @@
|
||||||
|
From 8985b12868f07d9ef501580d600e49fe8f230eb4 Mon Sep 17 00:00:00 2001
|
||||||
|
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
|
||||||
|
Date: Tue, 22 Aug 2017 09:49:42 +0200
|
||||||
|
Subject: [PATCH] Time-HiRes: Fix unreliable t/usleep.t and t/utime.t
|
||||||
|
MIME-Version: 1.0
|
||||||
|
Content-Type: text/plain; charset=UTF-8
|
||||||
|
Content-Transfer-Encoding: 8bit
|
||||||
|
|
||||||
|
Ported from Time-HiRes-1.9746.
|
||||||
|
|
||||||
|
The tests randomly failed on loaded machines because a CPU scheduler
|
||||||
|
could add unpredictable delays.
|
||||||
|
|
||||||
|
CPAN RT#122819
|
||||||
|
|
||||||
|
Signed-off-by: Petr Písař <ppisar@redhat.com>
|
||||||
|
---
|
||||||
|
dist/Time-HiRes/t/usleep.t | 4 ++--
|
||||||
|
dist/Time-HiRes/t/utime.t | 9 +++++----
|
||||||
|
2 files changed, 7 insertions(+), 6 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/dist/Time-HiRes/t/usleep.t b/dist/Time-HiRes/t/usleep.t
|
||||||
|
index 9322458..bb66cbe 100644
|
||||||
|
--- a/dist/Time-HiRes/t/usleep.t
|
||||||
|
+++ b/dist/Time-HiRes/t/usleep.t
|
||||||
|
@@ -32,7 +32,7 @@ SKIP: {
|
||||||
|
Time::HiRes::usleep(500_000);
|
||||||
|
my $f2 = Time::HiRes::time();
|
||||||
|
my $d = $f2 - $f;
|
||||||
|
- ok $d > 0.4 && $d < 0.9 or print("# slept $d secs $f to $f2\n");
|
||||||
|
+ ok $d > 0.49 or print("# slept $d secs $f to $f2\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
SKIP: {
|
||||||
|
@@ -40,7 +40,7 @@ SKIP: {
|
||||||
|
my $r = [ Time::HiRes::gettimeofday() ];
|
||||||
|
Time::HiRes::sleep( 0.5 );
|
||||||
|
my $f = Time::HiRes::tv_interval $r;
|
||||||
|
- ok $f > 0.4 && $f < 0.9 or print("# slept $f instead of 0.5 secs.\n");
|
||||||
|
+ ok $f > 0.49 or print("# slept $f instead of 0.5 secs.\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
SKIP: {
|
||||||
|
diff --git a/dist/Time-HiRes/t/utime.t b/dist/Time-HiRes/t/utime.t
|
||||||
|
index 22fd48e..c5c7e55 100644
|
||||||
|
--- a/dist/Time-HiRes/t/utime.t
|
||||||
|
+++ b/dist/Time-HiRes/t/utime.t
|
||||||
|
@@ -106,17 +106,18 @@ print "# utime undef sets time to now\n";
|
||||||
|
my ($fh2, $filename2) = tempfile( "Time-HiRes-utime-XXXXXXXXX", UNLINK => 1 );
|
||||||
|
|
||||||
|
my $now = Time::HiRes::time;
|
||||||
|
+ sleep(1);
|
||||||
|
is Time::HiRes::utime(undef, undef, $filename1, $fh2), 2, "Two files changed";
|
||||||
|
|
||||||
|
{
|
||||||
|
my ($got_atime, $got_mtime) = ( Time::HiRes::stat($fh1) )[8, 9];
|
||||||
|
- cmp_ok abs( $got_atime - $now), '<', 0.1, "File 1 atime set correctly";
|
||||||
|
- cmp_ok abs( $got_mtime - $now), '<', 0.1, "File 1 mtime set correctly";
|
||||||
|
+ cmp_ok $got_atime, '>=', $now, "File 1 atime set correctly";
|
||||||
|
+ cmp_ok $got_mtime, '>=', $now, "File 1 mtime set correctly";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
my ($got_atime, $got_mtime) = ( Time::HiRes::stat($filename2) )[8, 9];
|
||||||
|
- cmp_ok abs( $got_atime - $now), '<', 0.1, "File 2 atime set correctly";
|
||||||
|
- cmp_ok abs( $got_mtime - $now), '<', 0.1, "File 2 mtime set correctly";
|
||||||
|
+ cmp_ok $got_atime, '>=', $now, "File 2 atime set correctly";
|
||||||
|
+ cmp_ok $got_mtime, '>=', $now, "File 2 mtime set correctly";
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
--
|
||||||
|
2.9.5
|
||||||
|
|
|
@ -0,0 +1,72 @@
|
||||||
|
From 7b3e03bd309fcc48a135123a60678ae2596b1c38 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Tony Cook <tony@develop-help.com>
|
||||||
|
Date: Wed, 7 Jun 2017 15:00:26 +1000
|
||||||
|
Subject: [PATCH] clear the UTF8 flag on a glob if it isn't UTF8
|
||||||
|
MIME-Version: 1.0
|
||||||
|
Content-Type: text/plain; charset=UTF-8
|
||||||
|
Content-Transfer-Encoding: 8bit
|
||||||
|
|
||||||
|
Ported to 5.26.0:
|
||||||
|
|
||||||
|
commit 1097da16b21fe0a2257dba9937e55c0cca18f7e1
|
||||||
|
Author: Tony Cook <tony@develop-help.com>
|
||||||
|
Date: Wed Jun 7 15:00:26 2017 +1000
|
||||||
|
|
||||||
|
[perl #131263] clear the UTF8 flag on a glob if it isn't UTF8
|
||||||
|
|
||||||
|
Previously sv_2pv_flags() would set the UTF8 flag on a glob if it
|
||||||
|
had a UTF8 name, but wouldn't clear tha flag if it didn't.
|
||||||
|
|
||||||
|
This meant a name change, eg. if assigned another glob, from a UTF8
|
||||||
|
name to a non-UTF8 name would leave the flag set.
|
||||||
|
|
||||||
|
Signed-off-by: Petr Písař <ppisar@redhat.com>
|
||||||
|
---
|
||||||
|
sv.c | 2 ++
|
||||||
|
t/op/gv.t | 10 +++++++++-
|
||||||
|
2 files changed, 11 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/sv.c b/sv.c
|
||||||
|
index 9f3e28e..ae3dc95 100644
|
||||||
|
--- a/sv.c
|
||||||
|
+++ b/sv.c
|
||||||
|
@@ -3179,6 +3179,8 @@ Perl_sv_2pv_flags(pTHX_ SV *const sv, STRLEN *const lp, const I32 flags)
|
||||||
|
assert(SvPOK(buffer));
|
||||||
|
if (SvUTF8(buffer))
|
||||||
|
SvUTF8_on(sv);
|
||||||
|
+ else
|
||||||
|
+ SvUTF8_off(sv);
|
||||||
|
if (lp)
|
||||||
|
*lp = SvCUR(buffer);
|
||||||
|
return SvPVX(buffer);
|
||||||
|
diff --git a/t/op/gv.t b/t/op/gv.t
|
||||||
|
index 4fe6b00..670ccf6 100644
|
||||||
|
--- a/t/op/gv.t
|
||||||
|
+++ b/t/op/gv.t
|
||||||
|
@@ -12,7 +12,7 @@ BEGIN {
|
||||||
|
|
||||||
|
use warnings;
|
||||||
|
|
||||||
|
-plan(tests => 280);
|
||||||
|
+plan(tests => 282);
|
||||||
|
|
||||||
|
# type coercion on assignment
|
||||||
|
$foo = 'foo';
|
||||||
|
@@ -1170,6 +1170,14 @@ SKIP: {
|
||||||
|
is ($? & 127, 0,"[perl #128597] No crash when gp_free calls ckWARN_d");
|
||||||
|
}
|
||||||
|
|
||||||
|
+{
|
||||||
|
+ # [perl #131263]
|
||||||
|
+ *sym = "\N{U+0080}";
|
||||||
|
+ ok(*sym eq "*main::\N{U+0080}", "utf8 flag properly set");
|
||||||
|
+ *sym = "\xC3\x80";
|
||||||
|
+ ok(*sym eq "*main::\xC3\x80", "utf8 flag properly cleared");
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
# test gv_try_downgrade()
|
||||||
|
# If a GV can be stored in a stash in a compact, non-GV form, then
|
||||||
|
# whenever ops are freed which reference the GV, an attempt is made to
|
||||||
|
--
|
||||||
|
2.9.4
|
||||||
|
|
|
@ -0,0 +1,61 @@
|
||||||
|
From cb2fda94b02c5b7e8d16582410034f5a3dae526f Mon Sep 17 00:00:00 2001
|
||||||
|
From: Tony Cook <tony@develop-help.com>
|
||||||
|
Date: Tue, 25 Jul 2017 16:21:22 +1000
|
||||||
|
Subject: [PATCH] (perl #131588) be a little more careful in arybase::_tie_it()
|
||||||
|
MIME-Version: 1.0
|
||||||
|
Content-Type: text/plain; charset=UTF-8
|
||||||
|
Content-Transfer-Encoding: 8bit
|
||||||
|
|
||||||
|
Original patch by John Leitch <john@autosectools.com>
|
||||||
|
Petr Pisar: Ported to 5.26.0.
|
||||||
|
|
||||||
|
Signed-off-by: Petr Písař <ppisar@redhat.com>
|
||||||
|
---
|
||||||
|
ext/arybase/arybase.xs | 10 ++++++----
|
||||||
|
ext/arybase/t/arybase.t | 4 +++-
|
||||||
|
2 files changed, 9 insertions(+), 5 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/ext/arybase/arybase.xs b/ext/arybase/arybase.xs
|
||||||
|
index 880bbe3..216442a 100644
|
||||||
|
--- a/ext/arybase/arybase.xs
|
||||||
|
+++ b/ext/arybase/arybase.xs
|
||||||
|
@@ -438,10 +438,12 @@ _tie_it(SV *sv)
|
||||||
|
INIT:
|
||||||
|
GV * const gv = (GV *)sv;
|
||||||
|
CODE:
|
||||||
|
- if (GvSV(gv))
|
||||||
|
- /* This is *our* scalar now! */
|
||||||
|
- sv_unmagic(GvSV(gv), PERL_MAGIC_sv);
|
||||||
|
- tie(aTHX_ GvSVn(gv), NULL, GvSTASH(CvGV(cv)));
|
||||||
|
+ if (isGV(gv)) {
|
||||||
|
+ if (GvSV(gv))
|
||||||
|
+ /* This is *our* scalar now! */
|
||||||
|
+ sv_unmagic(GvSV(gv), PERL_MAGIC_sv);
|
||||||
|
+ tie(aTHX_ GvSVn(gv), NULL, GvSTASH(CvGV(cv)));
|
||||||
|
+ }
|
||||||
|
|
||||||
|
void
|
||||||
|
FETCH(...)
|
||||||
|
diff --git a/ext/arybase/t/arybase.t b/ext/arybase/t/arybase.t
|
||||||
|
index f3d3287..41e90df 100644
|
||||||
|
--- a/ext/arybase/t/arybase.t
|
||||||
|
+++ b/ext/arybase/t/arybase.t
|
||||||
|
@@ -4,7 +4,7 @@
|
||||||
|
# plus miscellaneous bug fix tests
|
||||||
|
|
||||||
|
no warnings 'deprecated';
|
||||||
|
-use Test::More tests => 7;
|
||||||
|
+use Test::More tests => 8;
|
||||||
|
|
||||||
|
sub outside_base_scope { return "${'['}" }
|
||||||
|
|
||||||
|
@@ -34,4 +34,6 @@ is $@, "That use of \$[ is unsupported at $f line $l.\n",
|
||||||
|
|
||||||
|
sub foo { my $x; $x = wait } # compilation of this routine used to crash
|
||||||
|
|
||||||
|
+ok eval { arybase::_tie_it(1); 1 }, "don't crash on bad call to _tie_it()";
|
||||||
|
+
|
||||||
|
1;
|
||||||
|
--
|
||||||
|
2.9.4
|
||||||
|
|
|
@ -0,0 +1,37 @@
|
||||||
|
From 37268580c0cfbf190ff9aa7859a604713cb366ee Mon Sep 17 00:00:00 2001
|
||||||
|
From: Yves Orton <demerphq@gmail.com>
|
||||||
|
Date: Tue, 27 Jun 2017 16:36:57 +0200
|
||||||
|
Subject: [PATCH] t/op/hash.t: fixup intermittently failing test
|
||||||
|
MIME-Version: 1.0
|
||||||
|
Content-Type: text/plain; charset=UTF-8
|
||||||
|
Content-Transfer-Encoding: 8bit
|
||||||
|
|
||||||
|
Port to 5.26.0:
|
||||||
|
|
||||||
|
commit b2ac59d1d0fda74d6612701d8316fe8dfb6a1b90
|
||||||
|
Author: Yves Orton <demerphq@gmail.com>
|
||||||
|
Date: Tue Jun 27 16:36:57 2017 +0200
|
||||||
|
|
||||||
|
t/op/hash.t: fixup intermittently failing test
|
||||||
|
|
||||||
|
Signed-off-by: Petr Písař <ppisar@redhat.com>
|
||||||
|
---
|
||||||
|
t/op/hash.t | 2 +-
|
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/t/op/hash.t b/t/op/hash.t
|
||||||
|
index a0e79c7..b941c57 100644
|
||||||
|
--- a/t/op/hash.t
|
||||||
|
+++ b/t/op/hash.t
|
||||||
|
@@ -206,7 +206,7 @@ sub torture_hash {
|
||||||
|
my $keys = pop @groups;
|
||||||
|
++$h->{$_} foreach @$keys;
|
||||||
|
my (undef, $total) = validate_hash("$desc " . keys %$h, $h);
|
||||||
|
- is($total, $total0, "bucket count is constant when rebuilding");
|
||||||
|
+ ok($total == $total0 || $total == ($total0*2), "bucket count is expected size when rebuilding");
|
||||||
|
is(scalar %$h, pop @groups, "scalar keys is identical when rebuilding");
|
||||||
|
++$h1->{$_} foreach @$keys;
|
||||||
|
validate_hash("$desc copy " . keys %$h1, $h1);
|
||||||
|
--
|
||||||
|
2.9.4
|
||||||
|
|
|
@ -0,0 +1,48 @@
|
||||||
|
From abd17348111a99642da217c45d836f2df5713594 Mon Sep 17 00:00:00 2001
|
||||||
|
From: John Lightsey <lightsey@debian.org>
|
||||||
|
Date: Tue, 31 Oct 2017 18:12:26 -0500
|
||||||
|
Subject: [PATCH] Fix deparsing of transliterations with unprintable
|
||||||
|
characters.
|
||||||
|
MIME-Version: 1.0
|
||||||
|
Content-Type: text/plain; charset=UTF-8
|
||||||
|
Content-Transfer-Encoding: 8bit
|
||||||
|
|
||||||
|
RT #132405
|
||||||
|
|
||||||
|
Signed-off-by: Nicolas R <atoomic@cpan.org>
|
||||||
|
Petr Písař: Port to 5.26.1.
|
||||||
|
Signed-off-by: Petr Písař <ppisar@redhat.com>
|
||||||
|
---
|
||||||
|
lib/B/Deparse.pm | 2 +-
|
||||||
|
lib/B/Deparse.t | 5 +++++
|
||||||
|
2 files changed, 6 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/lib/B/Deparse.pm b/lib/B/Deparse.pm
|
||||||
|
index 3166415..cc74552 100644
|
||||||
|
--- a/lib/B/Deparse.pm
|
||||||
|
+++ b/lib/B/Deparse.pm
|
||||||
|
@@ -5200,7 +5200,7 @@ sub pchr { # ASCII
|
||||||
|
} elsif ($n == ord "\r") {
|
||||||
|
return '\\r';
|
||||||
|
} elsif ($n >= ord("\cA") and $n <= ord("\cZ")) {
|
||||||
|
- return '\\c' . unctrl{chr $n};
|
||||||
|
+ return '\\c' . $unctrl{chr $n};
|
||||||
|
} else {
|
||||||
|
# return '\x' . sprintf("%02x", $n);
|
||||||
|
return '\\' . sprintf("%03o", $n);
|
||||||
|
diff --git a/lib/B/Deparse.t b/lib/B/Deparse.t
|
||||||
|
index 7eeb4f8..eae9c49 100644
|
||||||
|
--- a/lib/B/Deparse.t
|
||||||
|
+++ b/lib/B/Deparse.t
|
||||||
|
@@ -2610,3 +2610,8 @@ sub ($a, $=) {
|
||||||
|
$a;
|
||||||
|
}
|
||||||
|
;
|
||||||
|
+####
|
||||||
|
+# tr with unprintable characters
|
||||||
|
+my $str;
|
||||||
|
+$str = 'foo';
|
||||||
|
+$str =~ tr/\cA//;
|
||||||
|
--
|
||||||
|
2.13.6
|
||||||
|
|
|
@ -0,0 +1,111 @@
|
||||||
|
From 3dfcac940930a8aa6779f5debea6ea6357372419 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Daniel Dragan <bulk88@hotmail.com>
|
||||||
|
Date: Sun, 16 Aug 2015 04:30:23 -0400
|
||||||
|
Subject: [PATCH] fix do dir returning no $!
|
||||||
|
MIME-Version: 1.0
|
||||||
|
Content-Type: text/plain; charset=UTF-8
|
||||||
|
Content-Transfer-Encoding: 8bit
|
||||||
|
|
||||||
|
do()ing a directory was returning false/empty string in $!, which isn't
|
||||||
|
an error, yet documentation says $! should have the error code in it.
|
||||||
|
Fix this by returning EISDIR for dirs, and EINVAL for block devices.
|
||||||
|
[perl #125774]
|
||||||
|
|
||||||
|
Remove "errno = 0" and comment added in b2da7ead68, since now there is no
|
||||||
|
scenario where errno is uninitialized, since the dir and block device
|
||||||
|
failure branches now set errno, where previously they didn't.
|
||||||
|
|
||||||
|
Petr Písař: Ported to 5.26.1.
|
||||||
|
|
||||||
|
Signed-off-by: Petr Písař <ppisar@redhat.com>
|
||||||
|
---
|
||||||
|
pp_ctl.c | 25 +++++++++++++++++--------
|
||||||
|
t/op/do.t | 14 +++++++++++++-
|
||||||
|
2 files changed, 30 insertions(+), 9 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/pp_ctl.c b/pp_ctl.c
|
||||||
|
index e24d7b6..f136f91 100644
|
||||||
|
--- a/pp_ctl.c
|
||||||
|
+++ b/pp_ctl.c
|
||||||
|
@@ -3534,15 +3534,22 @@ S_check_type_and_open(pTHX_ SV *name)
|
||||||
|
errno EACCES, so only do a stat to separate a dir from a real EACCES
|
||||||
|
caused by user perms */
|
||||||
|
#ifndef WIN32
|
||||||
|
- /* we use the value of errno later to see how stat() or open() failed.
|
||||||
|
- * We don't want it set if the stat succeeded but we still failed,
|
||||||
|
- * such as if the name exists, but is a directory */
|
||||||
|
- errno = 0;
|
||||||
|
-
|
||||||
|
st_rc = PerlLIO_stat(p, &st);
|
||||||
|
|
||||||
|
- if (st_rc < 0 || S_ISDIR(st.st_mode) || S_ISBLK(st.st_mode)) {
|
||||||
|
+ if (st_rc < 0)
|
||||||
|
return NULL;
|
||||||
|
+ else {
|
||||||
|
+ int eno;
|
||||||
|
+ if(S_ISBLK(st.st_mode)) {
|
||||||
|
+ eno = EINVAL;
|
||||||
|
+ goto not_file;
|
||||||
|
+ }
|
||||||
|
+ else if(S_ISDIR(st.st_mode)) {
|
||||||
|
+ eno = EISDIR;
|
||||||
|
+ not_file:
|
||||||
|
+ errno = eno;
|
||||||
|
+ return NULL;
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
@@ -3554,8 +3561,10 @@ S_check_type_and_open(pTHX_ SV *name)
|
||||||
|
int eno;
|
||||||
|
st_rc = PerlLIO_stat(p, &st);
|
||||||
|
if (st_rc >= 0) {
|
||||||
|
- if(S_ISDIR(st.st_mode) || S_ISBLK(st.st_mode))
|
||||||
|
- eno = 0;
|
||||||
|
+ if(S_ISDIR(st.st_mode))
|
||||||
|
+ eno = EISDIR;
|
||||||
|
+ else if(S_ISBLK(st.st_mode))
|
||||||
|
+ eno = EINVAL;
|
||||||
|
else
|
||||||
|
eno = EACCES;
|
||||||
|
errno = eno;
|
||||||
|
diff --git a/t/op/do.t b/t/op/do.t
|
||||||
|
index 78d8800..1c54f0b 100644
|
||||||
|
--- a/t/op/do.t
|
||||||
|
+++ b/t/op/do.t
|
||||||
|
@@ -7,6 +7,7 @@ BEGIN {
|
||||||
|
}
|
||||||
|
use strict;
|
||||||
|
no warnings 'void';
|
||||||
|
+use Errno qw(ENOENT EISDIR);
|
||||||
|
|
||||||
|
my $called;
|
||||||
|
my $result = do{ ++$called; 'value';};
|
||||||
|
@@ -247,7 +248,7 @@ SKIP: {
|
||||||
|
my $saved_errno = $!;
|
||||||
|
ok(!$rv, "do returns false on io errror");
|
||||||
|
ok(!$saved_error, "\$\@ not set on io error");
|
||||||
|
- ok($saved_errno, "\$! set on io error");
|
||||||
|
+ ok($saved_errno == ENOENT, "\$! is ENOENT for nonexistent file");
|
||||||
|
}
|
||||||
|
|
||||||
|
# do subname should not be do "subname"
|
||||||
|
@@ -305,4 +306,15 @@ SKIP: {
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
+# do file $!s must be correct
|
||||||
|
+{
|
||||||
|
+ local @INC = ('.'); #want EISDIR not ENOENT
|
||||||
|
+ my $rv = do 'op'; # /t/op dir
|
||||||
|
+ my $saved_error = $@;
|
||||||
|
+ my $saved_errno = $!+0;
|
||||||
|
+ ok(!$rv, "do dir returns false");
|
||||||
|
+ ok(!$saved_error, "\$\@ is false on do dir");
|
||||||
|
+ ok($saved_errno == EISDIR, "\$! is EISDIR on do dir");
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
done_testing();
|
||||||
|
--
|
||||||
|
2.13.6
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,24 @@
|
||||||
|
commit 13e70b397dcb0d1bf4a869b670f041c1d7b730d0
|
||||||
|
Author: Björn Esser <besser82@fedoraproject.org>
|
||||||
|
Date: Sat Jan 20 20:22:53 2018 +0100
|
||||||
|
|
||||||
|
pp: Guard fix for really old bug in glibc libcrypt
|
||||||
|
|
||||||
|
diff --git a/pp.c b/pp.c
|
||||||
|
index d50ad7ddbf..6510c7b15c 100644
|
||||||
|
--- a/pp.c
|
||||||
|
+++ b/pp.c
|
||||||
|
@@ -3650,8 +3650,12 @@ PP(pp_crypt)
|
||||||
|
#if defined(__GLIBC__) || defined(__EMX__)
|
||||||
|
if (PL_reentrant_buffer->_crypt_struct_buffer) {
|
||||||
|
PL_reentrant_buffer->_crypt_struct_buffer->initialized = 0;
|
||||||
|
- /* work around glibc-2.2.5 bug */
|
||||||
|
+#if (defined(__GLIBC__) && __GLIBC__ == 2) && \
|
||||||
|
+ (defined(__GLIBC_MINOR__) && __GLIBC_MINOR__ >= 2 && __GLIBC_MINOR__ < 4)
|
||||||
|
+ /* work around glibc-2.2.5 bug, has been fixed at some
|
||||||
|
+ * time in glibc-2.3.X */
|
||||||
|
PL_reentrant_buffer->_crypt_struct_buffer->current_saltbits = 0;
|
||||||
|
+#endif
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
|
@ -0,0 +1,107 @@
|
||||||
|
From 7a962424149cc60f3a187d0213a12689dd5e806b Mon Sep 17 00:00:00 2001
|
||||||
|
From: Tony Cook <tony@develop-help.com>
|
||||||
|
Date: Mon, 14 Aug 2017 11:52:39 +1000
|
||||||
|
Subject: [PATCH] (perl #131746) avoid undefined behaviour in Copy() etc
|
||||||
|
MIME-Version: 1.0
|
||||||
|
Content-Type: text/plain; charset=UTF-8
|
||||||
|
Content-Transfer-Encoding: 8bit
|
||||||
|
|
||||||
|
These functions depend on C library functions which have undefined
|
||||||
|
behaviour when passed NULL pointers, even when passed a zero 'n' value.
|
||||||
|
|
||||||
|
Some compilers use this information, ie. assume the pointers are
|
||||||
|
non-NULL when optimizing any following code, so we do need to
|
||||||
|
prevent such unguarded calls.
|
||||||
|
|
||||||
|
My initial thought was to add conditionals to each macro to skip the
|
||||||
|
call to the library function when n is zero, but this adds a cost to
|
||||||
|
every use of these macros, even when the n value is always true.
|
||||||
|
|
||||||
|
So instead I added asserts() which will give us a much more visible
|
||||||
|
indicator of such broken code and revealed the pp_caller and Glob.xs
|
||||||
|
issues also patched here.
|
||||||
|
|
||||||
|
Petr Písař: Ported to 5.26.1 from
|
||||||
|
f14cf3632059d421de83cf901c7e849adc1fcd03.
|
||||||
|
|
||||||
|
Signed-off-by: Petr Písař <ppisar@redhat.com>
|
||||||
|
---
|
||||||
|
ext/File-Glob/Glob.xs | 2 +-
|
||||||
|
handy.h | 14 +++++++-------
|
||||||
|
pp_ctl.c | 3 ++-
|
||||||
|
pp_hot.c | 3 ++-
|
||||||
|
4 files changed, 12 insertions(+), 10 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/ext/File-Glob/Glob.xs b/ext/File-Glob/Glob.xs
|
||||||
|
index e0a3681..9779d54 100644
|
||||||
|
--- a/ext/File-Glob/Glob.xs
|
||||||
|
+++ b/ext/File-Glob/Glob.xs
|
||||||
|
@@ -121,7 +121,7 @@ iterate(pTHX_ bool(*globber)(pTHX_ AV *entries, const char *pat, STRLEN len, boo
|
||||||
|
|
||||||
|
/* chuck it all out, quick or slow */
|
||||||
|
if (gimme == G_ARRAY) {
|
||||||
|
- if (!on_stack) {
|
||||||
|
+ if (!on_stack && AvFILLp(entries) + 1) {
|
||||||
|
EXTEND(SP, AvFILLp(entries)+1);
|
||||||
|
Copy(AvARRAY(entries), SP+1, AvFILLp(entries)+1, SV *);
|
||||||
|
SP += AvFILLp(entries)+1;
|
||||||
|
diff --git a/handy.h b/handy.h
|
||||||
|
index 80f9cf4..88b5b55 100644
|
||||||
|
--- a/handy.h
|
||||||
|
+++ b/handy.h
|
||||||
|
@@ -2409,17 +2409,17 @@ void Perl_mem_log_del_sv(const SV *sv, const char *filename, const int linenumbe
|
||||||
|
#define Safefree(d) safefree(MEM_LOG_FREE((Malloc_t)(d)))
|
||||||
|
#endif
|
||||||
|
|
||||||
|
-#define Move(s,d,n,t) (MEM_WRAP_CHECK_(n,t) (void)memmove((char*)(d),(const char*)(s), (n) * sizeof(t)))
|
||||||
|
-#define Copy(s,d,n,t) (MEM_WRAP_CHECK_(n,t) (void)memcpy((char*)(d),(const char*)(s), (n) * sizeof(t)))
|
||||||
|
-#define Zero(d,n,t) (MEM_WRAP_CHECK_(n,t) (void)memzero((char*)(d), (n) * sizeof(t)))
|
||||||
|
+#define Move(s,d,n,t) (MEM_WRAP_CHECK_(n,t) assert(d), assert(s), (void)memmove((char*)(d),(const char*)(s), (n) * sizeof(t)))
|
||||||
|
+#define Copy(s,d,n,t) (MEM_WRAP_CHECK_(n,t) assert(d), assert(s), (void)memcpy((char*)(d),(const char*)(s), (n) * sizeof(t)))
|
||||||
|
+#define Zero(d,n,t) (MEM_WRAP_CHECK_(n,t) assert(d), (void)memzero((char*)(d), (n) * sizeof(t)))
|
||||||
|
|
||||||
|
-#define MoveD(s,d,n,t) (MEM_WRAP_CHECK_(n,t) memmove((char*)(d),(const char*)(s), (n) * sizeof(t)))
|
||||||
|
-#define CopyD(s,d,n,t) (MEM_WRAP_CHECK_(n,t) memcpy((char*)(d),(const char*)(s), (n) * sizeof(t)))
|
||||||
|
+#define MoveD(s,d,n,t) (MEM_WRAP_CHECK_(n,t) assert(d), assert(s), memmove((char*)(d),(const char*)(s), (n) * sizeof(t)))
|
||||||
|
+#define CopyD(s,d,n,t) (MEM_WRAP_CHECK_(n,t) assert(d), assert(s), memcpy((char*)(d),(const char*)(s), (n) * sizeof(t)))
|
||||||
|
#ifdef HAS_MEMSET
|
||||||
|
-#define ZeroD(d,n,t) (MEM_WRAP_CHECK_(n,t) memzero((char*)(d), (n) * sizeof(t)))
|
||||||
|
+#define ZeroD(d,n,t) (MEM_WRAP_CHECK_(n,t) assert(d), memzero((char*)(d), (n) * sizeof(t)))
|
||||||
|
#else
|
||||||
|
/* Using bzero(), which returns void. */
|
||||||
|
-#define ZeroD(d,n,t) (MEM_WRAP_CHECK_(n,t) memzero((char*)(d), (n) * sizeof(t)),d)
|
||||||
|
+#define ZeroD(d,n,t) (MEM_WRAP_CHECK_(n,t) assert(d), memzero((char*)(d), (n) * sizeof(t)),d)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define PoisonWith(d,n,t,b) (MEM_WRAP_CHECK_(n,t) (void)memset((char*)(d), (U8)(b), (n) * sizeof(t)))
|
||||||
|
diff --git a/pp_ctl.c b/pp_ctl.c
|
||||||
|
index 15c193b..f1c57bc 100644
|
||||||
|
--- a/pp_ctl.c
|
||||||
|
+++ b/pp_ctl.c
|
||||||
|
@@ -1971,7 +1971,8 @@ PP(pp_caller)
|
||||||
|
|
||||||
|
if (AvMAX(PL_dbargs) < AvFILLp(ary) + off)
|
||||||
|
av_extend(PL_dbargs, AvFILLp(ary) + off);
|
||||||
|
- Copy(AvALLOC(ary), AvARRAY(PL_dbargs), AvFILLp(ary) + 1 + off, SV*);
|
||||||
|
+ if (AvFILLp(ary) + 1 + off)
|
||||||
|
+ Copy(AvALLOC(ary), AvARRAY(PL_dbargs), AvFILLp(ary) + 1 + off, SV*);
|
||||||
|
AvFILLp(PL_dbargs) = AvFILLp(ary) + off;
|
||||||
|
}
|
||||||
|
mPUSHi(CopHINTS_get(cx->blk_oldcop));
|
||||||
|
diff --git a/pp_hot.c b/pp_hot.c
|
||||||
|
index 5899413..66b79ea 100644
|
||||||
|
--- a/pp_hot.c
|
||||||
|
+++ b/pp_hot.c
|
||||||
|
@@ -4138,7 +4138,8 @@ PP(pp_entersub)
|
||||||
|
AvARRAY(av) = ary;
|
||||||
|
}
|
||||||
|
|
||||||
|
- Copy(MARK+1,AvARRAY(av),items,SV*);
|
||||||
|
+ if (items)
|
||||||
|
+ Copy(MARK+1,AvARRAY(av),items,SV*);
|
||||||
|
AvFILLp(av) = items - 1;
|
||||||
|
}
|
||||||
|
if (UNLIKELY((cx->blk_u16 & OPpENTERSUB_LVAL_MASK) == OPpLVAL_INTRO &&
|
||||||
|
--
|
||||||
|
2.13.6
|
||||||
|
|
|
@ -0,0 +1,223 @@
|
||||||
|
From 4ac7295514f35016a79dbcc07500f6c9ca4729b7 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Tony Cook <tony@develop-help.com>
|
||||||
|
Date: Thu, 2 Nov 2017 20:18:56 +0000
|
||||||
|
Subject: [PATCH] (perl #131895) fail stat on names with \0 embedded
|
||||||
|
MIME-Version: 1.0
|
||||||
|
Content-Type: text/plain; charset=UTF-8
|
||||||
|
Content-Transfer-Encoding: 8bit
|
||||||
|
|
||||||
|
Also lstat() and the file test ops.
|
||||||
|
|
||||||
|
Petr Písař: Port to 5.26.1.
|
||||||
|
|
||||||
|
Signed-off-by: Petr Písař <ppisar@redhat.com>
|
||||||
|
---
|
||||||
|
doio.c | 21 ++++++++++++++++-----
|
||||||
|
pp_sys.c | 29 +++++++++++++++++++++++------
|
||||||
|
t/lib/warnings/pp_sys | 14 ++++++++++++++
|
||||||
|
t/op/filetest.t | 10 +++++++++-
|
||||||
|
t/op/stat.t | 12 +++++++++++-
|
||||||
|
5 files changed, 73 insertions(+), 13 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/doio.c b/doio.c
|
||||||
|
index becb19b..70d7747 100644
|
||||||
|
--- a/doio.c
|
||||||
|
+++ b/doio.c
|
||||||
|
@@ -1466,7 +1466,7 @@ Perl_my_stat_flags(pTHX_ const U32 flags)
|
||||||
|
return PL_laststatval;
|
||||||
|
else {
|
||||||
|
SV* const sv = TOPs;
|
||||||
|
- const char *s;
|
||||||
|
+ const char *s, *d;
|
||||||
|
STRLEN len;
|
||||||
|
if ((gv = MAYBE_DEREF_GV_flags(sv,flags))) {
|
||||||
|
goto do_fstat;
|
||||||
|
@@ -1480,9 +1480,14 @@ Perl_my_stat_flags(pTHX_ const U32 flags)
|
||||||
|
s = SvPV_flags_const(sv, len, flags);
|
||||||
|
PL_statgv = NULL;
|
||||||
|
sv_setpvn(PL_statname, s, len);
|
||||||
|
- s = SvPVX_const(PL_statname); /* s now NUL-terminated */
|
||||||
|
+ d = SvPVX_const(PL_statname); /* s now NUL-terminated */
|
||||||
|
PL_laststype = OP_STAT;
|
||||||
|
- PL_laststatval = PerlLIO_stat(s, &PL_statcache);
|
||||||
|
+ if (!IS_SAFE_PATHNAME(s, len, OP_NAME(PL_op))) {
|
||||||
|
+ PL_laststatval = -1;
|
||||||
|
+ }
|
||||||
|
+ else {
|
||||||
|
+ PL_laststatval = PerlLIO_stat(d, &PL_statcache);
|
||||||
|
+ }
|
||||||
|
if (PL_laststatval < 0 && ckWARN(WARN_NEWLINE) && should_warn_nl(s)) {
|
||||||
|
GCC_DIAG_IGNORE(-Wformat-nonliteral); /* PL_warn_nl is constant */
|
||||||
|
Perl_warner(aTHX_ packWARN(WARN_NEWLINE), PL_warn_nl, "stat");
|
||||||
|
@@ -1499,6 +1504,7 @@ Perl_my_lstat_flags(pTHX_ const U32 flags)
|
||||||
|
static const char* const no_prev_lstat = "The stat preceding -l _ wasn't an lstat";
|
||||||
|
dSP;
|
||||||
|
const char *file;
|
||||||
|
+ STRLEN len;
|
||||||
|
SV* const sv = TOPs;
|
||||||
|
bool isio = FALSE;
|
||||||
|
if (PL_op->op_flags & OPf_REF) {
|
||||||
|
@@ -1542,9 +1548,14 @@ Perl_my_lstat_flags(pTHX_ const U32 flags)
|
||||||
|
HEKfARG(GvENAME_HEK((const GV *)
|
||||||
|
(SvROK(sv) ? SvRV(sv) : sv))));
|
||||||
|
}
|
||||||
|
- file = SvPV_flags_const_nolen(sv, flags);
|
||||||
|
+ file = SvPV_flags_const(sv, len, flags);
|
||||||
|
sv_setpv(PL_statname,file);
|
||||||
|
- PL_laststatval = PerlLIO_lstat(file,&PL_statcache);
|
||||||
|
+ if (!IS_SAFE_PATHNAME(file, len, OP_NAME(PL_op))) {
|
||||||
|
+ PL_laststatval = -1;
|
||||||
|
+ }
|
||||||
|
+ else {
|
||||||
|
+ PL_laststatval = PerlLIO_lstat(file,&PL_statcache);
|
||||||
|
+ }
|
||||||
|
if (PL_laststatval < 0 && ckWARN(WARN_NEWLINE) && should_warn_nl(file)) {
|
||||||
|
GCC_DIAG_IGNORE(-Wformat-nonliteral); /* PL_warn_nl is constant */
|
||||||
|
Perl_warner(aTHX_ packWARN(WARN_NEWLINE), PL_warn_nl, "lstat");
|
||||||
|
diff --git a/pp_sys.c b/pp_sys.c
|
||||||
|
index 0b60584..1b81fda 100644
|
||||||
|
--- a/pp_sys.c
|
||||||
|
+++ b/pp_sys.c
|
||||||
|
@@ -2963,19 +2963,24 @@ PP(pp_stat)
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
const char *file;
|
||||||
|
+ const char *temp;
|
||||||
|
+ STRLEN len;
|
||||||
|
if (SvROK(sv) && SvTYPE(SvRV(sv)) == SVt_PVIO) {
|
||||||
|
io = MUTABLE_IO(SvRV(sv));
|
||||||
|
if (PL_op->op_type == OP_LSTAT)
|
||||||
|
goto do_fstat_warning_check;
|
||||||
|
goto do_fstat_have_io;
|
||||||
|
}
|
||||||
|
-
|
||||||
|
SvTAINTED_off(PL_statname); /* previous tainting irrelevant */
|
||||||
|
- sv_setpv(PL_statname, SvPV_nomg_const_nolen(sv));
|
||||||
|
+ temp = SvPV_nomg_const(sv, len);
|
||||||
|
+ sv_setpv(PL_statname, temp);
|
||||||
|
PL_statgv = NULL;
|
||||||
|
PL_laststype = PL_op->op_type;
|
||||||
|
file = SvPV_nolen_const(PL_statname);
|
||||||
|
- if (PL_op->op_type == OP_LSTAT)
|
||||||
|
+ if (!IS_SAFE_PATHNAME(temp, len, OP_NAME(PL_op))) {
|
||||||
|
+ PL_laststatval = -1;
|
||||||
|
+ }
|
||||||
|
+ else if (PL_op->op_type == OP_LSTAT)
|
||||||
|
PL_laststatval = PerlLIO_lstat(file, &PL_statcache);
|
||||||
|
else
|
||||||
|
PL_laststatval = PerlLIO_stat(file, &PL_statcache);
|
||||||
|
@@ -3211,8 +3216,12 @@ PP(pp_ftrread)
|
||||||
|
|
||||||
|
if (use_access) {
|
||||||
|
#if defined(HAS_ACCESS) || defined (PERL_EFF_ACCESS)
|
||||||
|
- const char *name = SvPV_nolen(*PL_stack_sp);
|
||||||
|
- if (effective) {
|
||||||
|
+ STRLEN len;
|
||||||
|
+ const char *name = SvPV(*PL_stack_sp, len);
|
||||||
|
+ if (!IS_SAFE_PATHNAME(name, len, OP_NAME(PL_op))) {
|
||||||
|
+ result = -1;
|
||||||
|
+ }
|
||||||
|
+ else if (effective) {
|
||||||
|
# ifdef PERL_EFF_ACCESS
|
||||||
|
result = PERL_EFF_ACCESS(name, access_mode);
|
||||||
|
# else
|
||||||
|
@@ -3537,10 +3546,18 @@ PP(pp_fttext)
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
const char *file;
|
||||||
|
+ const char *temp;
|
||||||
|
+ STRLEN temp_len;
|
||||||
|
int fd;
|
||||||
|
|
||||||
|
assert(sv);
|
||||||
|
- sv_setpv(PL_statname, SvPV_nomg_const_nolen(sv));
|
||||||
|
+ temp = SvPV_nomg_const(sv, temp_len);
|
||||||
|
+ sv_setpv(PL_statname, temp);
|
||||||
|
+ if (!IS_SAFE_PATHNAME(temp, temp_len, OP_NAME(PL_op))) {
|
||||||
|
+ PL_laststatval = -1;
|
||||||
|
+ PL_laststype = OP_STAT;
|
||||||
|
+ FT_RETURNUNDEF;
|
||||||
|
+ }
|
||||||
|
really_filename:
|
||||||
|
file = SvPVX_const(PL_statname);
|
||||||
|
PL_statgv = NULL;
|
||||||
|
diff --git a/t/lib/warnings/pp_sys b/t/lib/warnings/pp_sys
|
||||||
|
index 9c544e0..c599aa3 100644
|
||||||
|
--- a/t/lib/warnings/pp_sys
|
||||||
|
+++ b/t/lib/warnings/pp_sys
|
||||||
|
@@ -972,3 +972,17 @@ close $fh;
|
||||||
|
unlink $file;
|
||||||
|
EXPECT
|
||||||
|
syswrite() is deprecated on :utf8 handles. This will be a fatal error in Perl 5.30 at - line 5.
|
||||||
|
+########
|
||||||
|
+# NAME stat on name with \0
|
||||||
|
+use warnings;
|
||||||
|
+my @x = stat("./\0-");
|
||||||
|
+my @y = lstat("./\0-");
|
||||||
|
+-T ".\0-";
|
||||||
|
+-x ".\0-";
|
||||||
|
+-l ".\0-";
|
||||||
|
+EXPECT
|
||||||
|
+Invalid \0 character in pathname for stat: ./\0- at - line 2.
|
||||||
|
+Invalid \0 character in pathname for lstat: ./\0- at - line 3.
|
||||||
|
+Invalid \0 character in pathname for fttext: .\0- at - line 4.
|
||||||
|
+Invalid \0 character in pathname for fteexec: .\0- at - line 5.
|
||||||
|
+Invalid \0 character in pathname for ftlink: .\0- at - line 6.
|
||||||
|
diff --git a/t/op/filetest.t b/t/op/filetest.t
|
||||||
|
index 8883381..bd1d08c 100644
|
||||||
|
--- a/t/op/filetest.t
|
||||||
|
+++ b/t/op/filetest.t
|
||||||
|
@@ -9,7 +9,7 @@ BEGIN {
|
||||||
|
set_up_inc(qw '../lib ../cpan/Perl-OSType/lib');
|
||||||
|
}
|
||||||
|
|
||||||
|
-plan(tests => 53 + 27*14);
|
||||||
|
+plan(tests => 57 + 27*14);
|
||||||
|
|
||||||
|
if ($^O =~ /MSWin32|cygwin|msys/ && !is_miniperl) {
|
||||||
|
require Win32; # for IsAdminUser()
|
||||||
|
@@ -393,3 +393,11 @@ SKIP: {
|
||||||
|
is $failed_stat2, $failed_stat1,
|
||||||
|
'failed -r($gv_with_io_but_no_fp) with and w/out fatal warnings';
|
||||||
|
}
|
||||||
|
+
|
||||||
|
+{
|
||||||
|
+ # [perl #131895] stat() doesn't fail on filenames containing \0 / NUL
|
||||||
|
+ ok(!-T "TEST\0-", '-T on name with \0');
|
||||||
|
+ ok(!-B "TEST\0-", '-B on name with \0');
|
||||||
|
+ ok(!-f "TEST\0-", '-f on name with \0');
|
||||||
|
+ ok(!-r "TEST\0-", '-r on name with \0');
|
||||||
|
+}
|
||||||
|
diff --git a/t/op/stat.t b/t/op/stat.t
|
||||||
|
index 323c498..dbbe6ec 100644
|
||||||
|
--- a/t/op/stat.t
|
||||||
|
+++ b/t/op/stat.t
|
||||||
|
@@ -25,7 +25,7 @@ if ($^O eq 'MSWin32') {
|
||||||
|
${^WIN32_SLOPPY_STAT} = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
-plan tests => 118;
|
||||||
|
+plan tests => 120;
|
||||||
|
|
||||||
|
my $Perl = which_perl();
|
||||||
|
|
||||||
|
@@ -653,6 +653,16 @@ SKIP:
|
||||||
|
'stat on an array of valid paths should return ENOENT';
|
||||||
|
}
|
||||||
|
|
||||||
|
+# [perl #131895] stat() doesn't fail on filenames containing \0 / NUL
|
||||||
|
+ok !stat("TEST\0-"), 'stat on filename with \0';
|
||||||
|
+SKIP: {
|
||||||
|
+ my $link = "TEST.symlink.$$";
|
||||||
|
+ my $can_symlink = eval { symlink "TEST", $link };
|
||||||
|
+ skip "cannot symlink", 1 unless $can_symlink;
|
||||||
|
+ ok !lstat("$link\0-"), 'lstat on filename with \0';
|
||||||
|
+ unlink $link;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
END {
|
||||||
|
chmod 0666, $tmpfile;
|
||||||
|
unlink_all $tmpfile;
|
||||||
|
--
|
||||||
|
2.13.6
|
||||||
|
|
|
@ -0,0 +1,54 @@
|
||||||
|
From dc5c68130b7c8b727e9e792506183c255fc2bc70 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Tony Cook <tony@develop-help.com>
|
||||||
|
Date: Thu, 19 Oct 2017 10:46:04 +1100
|
||||||
|
Subject: [PATCH] (perl #132245) don't try to process a char range with no
|
||||||
|
preceding char
|
||||||
|
MIME-Version: 1.0
|
||||||
|
Content-Type: text/plain; charset=UTF-8
|
||||||
|
Content-Transfer-Encoding: 8bit
|
||||||
|
|
||||||
|
A range like \N{}-0 eventually results in compilation failing, but
|
||||||
|
before that, get_and_check_backslash_N_name() attempts to treat
|
||||||
|
the memory before the empty output of \N{} as a character.
|
||||||
|
|
||||||
|
Petr Písař: Ported to 5.26.1.
|
||||||
|
|
||||||
|
Signed-off-by: Petr Písař <ppisar@redhat.com>
|
||||||
|
---
|
||||||
|
t/lib/warnings/toke | 5 +++++
|
||||||
|
toke.c | 6 +++---
|
||||||
|
2 files changed, 8 insertions(+), 3 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/t/lib/warnings/toke b/t/lib/warnings/toke
|
||||||
|
index fc51d9f..398ee22 100644
|
||||||
|
--- a/t/lib/warnings/toke
|
||||||
|
+++ b/t/lib/warnings/toke
|
||||||
|
@@ -1651,3 +1651,8 @@ Execution of - aborted due to compilation errors.
|
||||||
|
use utf8;
|
||||||
|
qw∘foo ∞ ♥ bar∘
|
||||||
|
EXPECT
|
||||||
|
+########
|
||||||
|
+# NAME tr/// range with empty \N{} at the start
|
||||||
|
+tr//\N{}-0/;
|
||||||
|
+EXPECT
|
||||||
|
+Unknown charname '' is deprecated. Its use will be fatal in Perl 5.28 at - line 1.
|
||||||
|
diff --git a/toke.c b/toke.c
|
||||||
|
index 6f84d2d..6ee7a68 100644
|
||||||
|
--- a/toke.c
|
||||||
|
+++ b/toke.c
|
||||||
|
@@ -2958,9 +2958,9 @@ S_scan_const(pTHX_ char *start)
|
||||||
|
|
||||||
|
/* Here, we don't think we're in a range. If the new character
|
||||||
|
* is not a hyphen; or if it is a hyphen, but it's too close to
|
||||||
|
- * either edge to indicate a range, then it's a regular
|
||||||
|
- * character. */
|
||||||
|
- if (*s != '-' || s >= send - 1 || s == start) {
|
||||||
|
+ * either edge to indicate a range, or if we haven't output any
|
||||||
|
+ * characters yet then it's a regular character. */
|
||||||
|
+ if (*s != '-' || s >= send - 1 || s == start || d == SvPVX(sv)) {
|
||||||
|
|
||||||
|
/* A regular character. Process like any other, but first
|
||||||
|
* clear any flags */
|
||||||
|
--
|
||||||
|
2.13.6
|
||||||
|
|
|
@ -0,0 +1,211 @@
|
||||||
|
From 8c7182b26a43f14cd8afbfbe4448cbbd691c3609 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Zefram <zefram@fysh.org>
|
||||||
|
Date: Wed, 15 Nov 2017 08:11:37 +0000
|
||||||
|
Subject: [PATCH] set $! when statting a closed filehandle
|
||||||
|
MIME-Version: 1.0
|
||||||
|
Content-Type: text/plain; charset=UTF-8
|
||||||
|
Content-Transfer-Encoding: 8bit
|
||||||
|
|
||||||
|
When a stat fails because it's on a closed or otherwise invalid
|
||||||
|
filehandle, $! was often not being set, depending on the operation
|
||||||
|
and the nature of the invalidity. Consistently set it to EBADF.
|
||||||
|
Fixes [perl #108288].
|
||||||
|
|
||||||
|
Petr Písař: Ported to 5.26.1.
|
||||||
|
|
||||||
|
Signed-off-by: Petr Písař <ppisar@redhat.com>
|
||||||
|
---
|
||||||
|
MANIFEST | 1 +
|
||||||
|
doio.c | 10 +++++++++-
|
||||||
|
pp_sys.c | 22 ++++++++++++---------
|
||||||
|
t/op/stat_errors.t | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||||
|
4 files changed, 80 insertions(+), 10 deletions(-)
|
||||||
|
create mode 100644 t/op/stat_errors.t
|
||||||
|
|
||||||
|
diff --git a/MANIFEST b/MANIFEST
|
||||||
|
index fcbf5cc..996759e 100644
|
||||||
|
--- a/MANIFEST
|
||||||
|
+++ b/MANIFEST
|
||||||
|
@@ -5670,6 +5670,7 @@ t/op/srand.t See if srand works
|
||||||
|
t/op/sselect.t See if 4 argument select works
|
||||||
|
t/op/stash.t See if %:: stashes work
|
||||||
|
t/op/stat.t See if stat works
|
||||||
|
+t/op/stat_errors.t See if stat and file tests handle threshold errors
|
||||||
|
t/op/state.t See if state variables work
|
||||||
|
t/op/study.t See if study works
|
||||||
|
t/op/studytied.t See if study works with tied scalars
|
||||||
|
diff --git a/doio.c b/doio.c
|
||||||
|
index 70d7747..71dc6e4 100644
|
||||||
|
--- a/doio.c
|
||||||
|
+++ b/doio.c
|
||||||
|
@@ -1437,8 +1437,11 @@ Perl_my_stat_flags(pTHX_ const U32 flags)
|
||||||
|
if (PL_op->op_flags & OPf_REF) {
|
||||||
|
gv = cGVOP_gv;
|
||||||
|
do_fstat:
|
||||||
|
- if (gv == PL_defgv)
|
||||||
|
+ if (gv == PL_defgv) {
|
||||||
|
+ if (PL_laststatval < 0)
|
||||||
|
+ SETERRNO(EBADF,RMS_IFI);
|
||||||
|
return PL_laststatval;
|
||||||
|
+ }
|
||||||
|
io = GvIO(gv);
|
||||||
|
do_fstat_have_io:
|
||||||
|
PL_laststype = OP_STAT;
|
||||||
|
@@ -1449,6 +1452,7 @@ Perl_my_stat_flags(pTHX_ const U32 flags)
|
||||||
|
int fd = PerlIO_fileno(IoIFP(io));
|
||||||
|
if (fd < 0) {
|
||||||
|
/* E.g. PerlIO::scalar has no real fd. */
|
||||||
|
+ SETERRNO(EBADF,RMS_IFI);
|
||||||
|
return (PL_laststatval = -1);
|
||||||
|
} else {
|
||||||
|
return (PL_laststatval = PerlLIO_fstat(fd, &PL_statcache));
|
||||||
|
@@ -1459,6 +1463,7 @@ Perl_my_stat_flags(pTHX_ const U32 flags)
|
||||||
|
}
|
||||||
|
PL_laststatval = -1;
|
||||||
|
report_evil_fh(gv);
|
||||||
|
+ SETERRNO(EBADF,RMS_IFI);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
else if ((PL_op->op_private & (OPpFT_STACKED|OPpFT_AFTER_t))
|
||||||
|
@@ -1511,6 +1516,8 @@ Perl_my_lstat_flags(pTHX_ const U32 flags)
|
||||||
|
if (cGVOP_gv == PL_defgv) {
|
||||||
|
if (PL_laststype != OP_LSTAT)
|
||||||
|
Perl_croak(aTHX_ "%s", no_prev_lstat);
|
||||||
|
+ if (PL_laststatval < 0)
|
||||||
|
+ SETERRNO(EBADF,RMS_IFI);
|
||||||
|
return PL_laststatval;
|
||||||
|
}
|
||||||
|
PL_laststatval = -1;
|
||||||
|
@@ -1520,6 +1527,7 @@ Perl_my_lstat_flags(pTHX_ const U32 flags)
|
||||||
|
"Use of -l on filehandle %" HEKf,
|
||||||
|
HEKfARG(GvENAME_HEK(cGVOP_gv)));
|
||||||
|
}
|
||||||
|
+ SETERRNO(EBADF,RMS_IFI);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
if ((PL_op->op_private & (OPpFT_STACKED|OPpFT_AFTER_t))
|
||||||
|
diff --git a/pp_sys.c b/pp_sys.c
|
||||||
|
index fefbea3..87961f1 100644
|
||||||
|
--- a/pp_sys.c
|
||||||
|
+++ b/pp_sys.c
|
||||||
|
@@ -2925,10 +2925,11 @@ PP(pp_stat)
|
||||||
|
Perl_croak(aTHX_ "The stat preceding lstat() wasn't an lstat");
|
||||||
|
}
|
||||||
|
|
||||||
|
- if (gv != PL_defgv) {
|
||||||
|
- bool havefp;
|
||||||
|
+ if (gv == PL_defgv) {
|
||||||
|
+ if (PL_laststatval < 0)
|
||||||
|
+ SETERRNO(EBADF,RMS_IFI);
|
||||||
|
+ } else {
|
||||||
|
do_fstat_have_io:
|
||||||
|
- havefp = FALSE;
|
||||||
|
PL_laststype = OP_STAT;
|
||||||
|
PL_statgv = gv ? gv : (GV *)io;
|
||||||
|
SvPVCLEAR(PL_statname);
|
||||||
|
@@ -2939,22 +2940,25 @@ PP(pp_stat)
|
||||||
|
if (IoIFP(io)) {
|
||||||
|
int fd = PerlIO_fileno(IoIFP(io));
|
||||||
|
if (fd < 0) {
|
||||||
|
+ report_evil_fh(gv);
|
||||||
|
PL_laststatval = -1;
|
||||||
|
SETERRNO(EBADF,RMS_IFI);
|
||||||
|
} else {
|
||||||
|
PL_laststatval = PerlLIO_fstat(fd, &PL_statcache);
|
||||||
|
- havefp = TRUE;
|
||||||
|
}
|
||||||
|
} else if (IoDIRP(io)) {
|
||||||
|
PL_laststatval =
|
||||||
|
PerlLIO_fstat(my_dirfd(IoDIRP(io)), &PL_statcache);
|
||||||
|
- havefp = TRUE;
|
||||||
|
} else {
|
||||||
|
+ report_evil_fh(gv);
|
||||||
|
PL_laststatval = -1;
|
||||||
|
+ SETERRNO(EBADF,RMS_IFI);
|
||||||
|
}
|
||||||
|
- }
|
||||||
|
- else PL_laststatval = -1;
|
||||||
|
- if (PL_laststatval < 0 && !havefp) report_evil_fh(gv);
|
||||||
|
+ } else {
|
||||||
|
+ report_evil_fh(gv);
|
||||||
|
+ PL_laststatval = -1;
|
||||||
|
+ SETERRNO(EBADF,RMS_IFI);
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
|
||||||
|
if (PL_laststatval < 0) {
|
||||||
|
@@ -3451,7 +3455,7 @@ PP(pp_fttty)
|
||||||
|
else if (name && isDIGIT(*name) && grok_atoUV(name, &uv, NULL) && uv <= PERL_INT_MAX)
|
||||||
|
fd = (int)uv;
|
||||||
|
else
|
||||||
|
- FT_RETURNUNDEF;
|
||||||
|
+ fd = -1;
|
||||||
|
if (fd < 0) {
|
||||||
|
SETERRNO(EBADF,RMS_IFI);
|
||||||
|
FT_RETURNUNDEF;
|
||||||
|
diff --git a/t/op/stat_errors.t b/t/op/stat_errors.t
|
||||||
|
new file mode 100644
|
||||||
|
index 0000000..e043c61
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/t/op/stat_errors.t
|
||||||
|
@@ -0,0 +1,57 @@
|
||||||
|
+#!./perl
|
||||||
|
+
|
||||||
|
+BEGIN {
|
||||||
|
+ chdir 't' if -d 't';
|
||||||
|
+ require './test.pl';
|
||||||
|
+ set_up_inc('../lib');
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+plan(tests => 2*11*29);
|
||||||
|
+
|
||||||
|
+use Errno qw(EBADF ENOENT);
|
||||||
|
+
|
||||||
|
+open(SCALARFILE, "<", \"wibble") or die $!;
|
||||||
|
+open(CLOSEDFILE, "<", "./test.pl") or die $!;
|
||||||
|
+close(CLOSEDFILE) or die $!;
|
||||||
|
+opendir(CLOSEDDIR, "../lib") or die $!;
|
||||||
|
+closedir(CLOSEDDIR) or die $!;
|
||||||
|
+
|
||||||
|
+foreach my $op (
|
||||||
|
+ qw(stat lstat),
|
||||||
|
+ (map { "-$_" } qw(r w x o R W X O e z s f d l p S b c t u g k T B M A C)),
|
||||||
|
+) {
|
||||||
|
+ foreach my $arg (
|
||||||
|
+ (map { ($_, "\\*$_") }
|
||||||
|
+ qw(NEVEROPENED SCALARFILE CLOSEDFILE CLOSEDDIR _)),
|
||||||
|
+ "\"tmpnotexist\"",
|
||||||
|
+ ) {
|
||||||
|
+ my $argdesc = $arg;
|
||||||
|
+ if ($arg eq "_") {
|
||||||
|
+ my @z = lstat "tmpnotexist";
|
||||||
|
+ $argdesc .= " with prior stat fail";
|
||||||
|
+ }
|
||||||
|
+ SKIP: {
|
||||||
|
+ if ($op eq "-l" && $arg =~ /\A\\/) {
|
||||||
|
+ # The op weirdly stringifies the globref and uses it as
|
||||||
|
+ # a filename, rather than treating it as a file handle.
|
||||||
|
+ # That might be a bug, but while that behaviour exists it
|
||||||
|
+ # needs to be exempted from these tests.
|
||||||
|
+ skip "-l on globref", 2;
|
||||||
|
+ }
|
||||||
|
+ if ($op eq "-t" && $arg eq "\"tmpnotexist\"") {
|
||||||
|
+ # The op doesn't operate on filenames.
|
||||||
|
+ skip "-t on filename", 2;
|
||||||
|
+ }
|
||||||
|
+ $! = 0;
|
||||||
|
+ my $res = eval "$op $arg";
|
||||||
|
+ my $err = $!;
|
||||||
|
+ is $res, $op =~ /\A-/ ? undef : !!0, "result of $op $arg";
|
||||||
|
+ is 0+$err,
|
||||||
|
+ $arg eq "\"tmpnotexist\"" ||
|
||||||
|
+ ($op =~ /\A-[TB]\z/ && $arg =~ /_\z/) ? ENOENT : EBADF,
|
||||||
|
+ "error from $op $arg";
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+1;
|
||||||
|
--
|
||||||
|
2.13.6
|
||||||
|
|
|
@ -0,0 +1,105 @@
|
||||||
|
From dc1f8f6b581a8e4efbb782398ab3e7c3a52b062f Mon Sep 17 00:00:00 2001
|
||||||
|
From: Karl Williamson <khw@cpan.org>
|
||||||
|
Date: Tue, 8 May 2018 12:13:18 -0600
|
||||||
|
Subject: [PATCH] PATCH: [perl #133185] Infinite loop in qr//
|
||||||
|
MIME-Version: 1.0
|
||||||
|
Content-Type: text/plain; charset=UTF-8
|
||||||
|
Content-Transfer-Encoding: 8bit
|
||||||
|
|
||||||
|
This loop was inadvertently introduced as part of patches to fix
|
||||||
|
(perl #132227 CVE-2018-6797] heap-buffer-overflow". The commit in 5.27
|
||||||
|
responsible was f8fb8615ddc5a80e3bbd4386a8914497f921b62d.
|
||||||
|
|
||||||
|
To be vulnerable, the pattern must start out as /d (hence no use 5.012
|
||||||
|
or higher), and then there must be something that implicitly forces /u
|
||||||
|
(which the \pp does in the test case added by this patch), and then
|
||||||
|
(?aa), and then the code point \xDF. (German Sharp S). The /i must be
|
||||||
|
in effect by the time the DF is encountered, but it needn't come in the
|
||||||
|
(?aa) which the test does.
|
||||||
|
|
||||||
|
The problem is that the conditional that is testing that we switched
|
||||||
|
away from /d rules is assuming that this happened during the
|
||||||
|
construction of the current EXACTFish node. The comments I wrote
|
||||||
|
indicate this assumption. But this example shows that the switch can
|
||||||
|
come before this node started getting constructed, and so it loops.
|
||||||
|
|
||||||
|
The patch explicitly saves the state at the beginning of this node's
|
||||||
|
construction, and only retries if it changed during that construction.
|
||||||
|
Therefore the next time through, it will see that it hasn't changed
|
||||||
|
since the previous time, and won't loop.
|
||||||
|
|
||||||
|
Petr Písař: Ported to 5.26.2 from:
|
||||||
|
|
||||||
|
commit 0b9cb33b146b3eb55634853f883a880771dd1413
|
||||||
|
Author: Karl Williamson <khw@cpan.org>
|
||||||
|
Date: Tue May 8 12:13:18 2018 -0600
|
||||||
|
|
||||||
|
PATCH: [perl #133185] Infinite loop in qr//
|
||||||
|
|
||||||
|
Signed-off-by: Petr Písař <ppisar@redhat.com>
|
||||||
|
---
|
||||||
|
regcomp.c | 10 +++++++++-
|
||||||
|
t/re/speed.t | 5 ++++-
|
||||||
|
2 files changed, 13 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/regcomp.c b/regcomp.c
|
||||||
|
index 845e660..18fa465 100644
|
||||||
|
--- a/regcomp.c
|
||||||
|
+++ b/regcomp.c
|
||||||
|
@@ -13100,6 +13100,10 @@ S_regatom(pTHX_ RExC_state_t *pRExC_state, I32 *flagp, U32 depth)
|
||||||
|
bool maybe_exactfu = PASS2
|
||||||
|
&& (node_type == EXACTF || node_type == EXACTFL);
|
||||||
|
|
||||||
|
+ /* To see if RExC_uni_semantics changes during parsing of the node.
|
||||||
|
+ * */
|
||||||
|
+ bool uni_semantics_at_node_start;
|
||||||
|
+
|
||||||
|
/* If a folding node contains only code points that don't
|
||||||
|
* participate in folds, it can be changed into an EXACT node,
|
||||||
|
* which allows the optimizer more things to look for */
|
||||||
|
@@ -13147,6 +13151,8 @@ S_regatom(pTHX_ RExC_state_t *pRExC_state, I32 *flagp, U32 depth)
|
||||||
|
|| UTF8_IS_INVARIANT(UCHARAT(RExC_parse))
|
||||||
|
|| UTF8_IS_START(UCHARAT(RExC_parse)));
|
||||||
|
|
||||||
|
+ uni_semantics_at_node_start = RExC_uni_semantics;
|
||||||
|
+
|
||||||
|
/* Here, we have a literal character. Find the maximal string of
|
||||||
|
* them in the input that we can fit into a single EXACTish node.
|
||||||
|
* We quit at the first non-literal or when the node gets full */
|
||||||
|
@@ -13550,7 +13556,9 @@ S_regatom(pTHX_ RExC_state_t *pRExC_state, I32 *flagp, U32 depth)
|
||||||
|
* didn't think it needed to reparse. But this
|
||||||
|
* sharp s now does indicate the need for
|
||||||
|
* reparsing. */
|
||||||
|
- if (RExC_uni_semantics) {
|
||||||
|
+ if ( uni_semantics_at_node_start
|
||||||
|
+ != RExC_uni_semantics)
|
||||||
|
+ {
|
||||||
|
p = oldp;
|
||||||
|
goto loopdone;
|
||||||
|
}
|
||||||
|
diff --git a/t/re/speed.t b/t/re/speed.t
|
||||||
|
index 4a4830f..9a57de1 100644
|
||||||
|
--- a/t/re/speed.t
|
||||||
|
+++ b/t/re/speed.t
|
||||||
|
@@ -24,7 +24,7 @@ BEGIN {
|
||||||
|
skip_all('no re module') unless defined &DynaLoader::boot_DynaLoader;
|
||||||
|
skip_all_without_unicode_tables();
|
||||||
|
|
||||||
|
-plan tests => 58; #** update watchdog timeouts proportionally when adding tests
|
||||||
|
+plan tests => 59; #** update watchdog timeouts proportionally when adding tests
|
||||||
|
|
||||||
|
use strict;
|
||||||
|
use warnings;
|
||||||
|
@@ -156,6 +156,9 @@ PROG
|
||||||
|
ok( $elapsed <= 1, "should not COW on long string with substr and m//g");
|
||||||
|
}
|
||||||
|
|
||||||
|
+ # [perl #133185] Infinite loop
|
||||||
|
+ like("!\xdf", eval 'qr/\pp(?aai)\xdf/',
|
||||||
|
+ 'Compiling qr/\pp(?aai)\xdf/ doesn\'t loop');
|
||||||
|
|
||||||
|
} # End of sub run_tests
|
||||||
|
|
||||||
|
--
|
||||||
|
2.14.3
|
||||||
|
|
|
@ -10,7 +10,7 @@ diff --git a/Makefile.SH b/Makefile.SH
|
||||||
index 5fc6d1c..e89ad70 100755
|
index 5fc6d1c..e89ad70 100755
|
||||||
--- a/Makefile.SH
|
--- a/Makefile.SH
|
||||||
+++ b/Makefile.SH
|
+++ b/Makefile.SH
|
||||||
@@ -462,6 +462,8 @@ CCCMD = sh $(shellflags) cflags "optimize='$(OPTIMIZE)'" $@
|
@@ -457,6 +457,8 @@ CCCMD = sh $(shellflags) cflags "optimize='$(OPTIMIZE)'" $@
|
||||||
|
|
||||||
CCCMDSRC = sh $(shellflags) cflags "optimize='$(OPTIMIZE)'" $<
|
CCCMDSRC = sh $(shellflags) cflags "optimize='$(OPTIMIZE)'" $<
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ index 5fc6d1c..e89ad70 100755
|
||||||
CONFIGPM_FROM_CONFIG_SH = lib/Config.pm lib/Config_heavy.pl
|
CONFIGPM_FROM_CONFIG_SH = lib/Config.pm lib/Config_heavy.pl
|
||||||
CONFIGPM = $(CONFIGPM_FROM_CONFIG_SH) lib/Config_git.pl
|
CONFIGPM = $(CONFIGPM_FROM_CONFIG_SH) lib/Config_git.pl
|
||||||
|
|
||||||
@@ -895,19 +897,19 @@ $(DTRACE_MINI_O): perldtrace.d $(miniperl_objs_nodt)
|
@@ -890,19 +892,19 @@ $(DTRACE_MINI_O): perldtrace.d $(miniperl_objs_nodt)
|
||||||
-rm -rf mpdtrace
|
-rm -rf mpdtrace
|
||||||
mkdir mpdtrace
|
mkdir mpdtrace
|
||||||
cp $(miniperl_objs_nodt) mpdtrace/
|
cp $(miniperl_objs_nodt) mpdtrace/
|
||||||
|
@ -46,10 +46,10 @@ diff --git a/cflags.SH b/cflags.SH
|
||||||
index 3af1e97..b845127 100755
|
index 3af1e97..b845127 100755
|
||||||
--- a/cflags.SH
|
--- a/cflags.SH
|
||||||
+++ b/cflags.SH
|
+++ b/cflags.SH
|
||||||
@@ -519,7 +519,10 @@ for file do
|
@@ -516,7 +516,10 @@ for file do
|
||||||
toke) optimize=-O0 ;;
|
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
# Can we perhaps use $ansi2knr here
|
||||||
- echo "$cc -c -DPERL_CORE $ccflags $stdflags $optimize $warn $extra"
|
- echo "$cc -c -DPERL_CORE $ccflags $stdflags $optimize $warn $extra"
|
||||||
+ case "$file" in
|
+ case "$file" in
|
||||||
+ dtrace_*) echo "$ccflags $stdflags $optimize $warn $extra";;
|
+ dtrace_*) echo "$ccflags $stdflags $optimize $warn $extra";;
|
|
@ -0,0 +1,143 @@
|
||||||
|
From 07ebe9c4fb1028d17e61caabe8c15abd0cd48983 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Yves Orton <demerphq@gmail.com>
|
||||||
|
Date: Thu, 29 Jun 2017 11:31:14 +0200
|
||||||
|
Subject: [PATCH] Parse caret vars with subscripts the same as normal vars
|
||||||
|
inside of ${..} escaping
|
||||||
|
MIME-Version: 1.0
|
||||||
|
Content-Type: text/plain; charset=UTF-8
|
||||||
|
Content-Transfer-Encoding: 8bit
|
||||||
|
|
||||||
|
This behavior is discussed in perl #131664, which complains that
|
||||||
|
"${^CAPTURE}[0]" does not work as expected. Abigail explains the
|
||||||
|
behavior is by design and Eirik Berg Hanssen expands on that explanation
|
||||||
|
pointing out that what /should/ work, "${^CAPTURE[0]}" does not,
|
||||||
|
which Sawyer then ruled was a bug.
|
||||||
|
|
||||||
|
So this patch makes "${^CAPTURE[0]}" (and "${^CAPTURE [0]}" [hi
|
||||||
|
abigial]) work the same as they would if the var was called @foo.
|
||||||
|
|
||||||
|
Petr Písař: Ported to 5.26.2-RC1.
|
||||||
|
|
||||||
|
Signed-off-by: Petr Písař <ppisar@redhat.com>
|
||||||
|
---
|
||||||
|
t/base/lex.t | 28 +++++++++++++++++++++++++++-
|
||||||
|
toke.c | 46 +++++++++++++++++++++++++---------------------
|
||||||
|
2 files changed, 52 insertions(+), 22 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/t/base/lex.t b/t/base/lex.t
|
||||||
|
index 99fd3bb..ae17bbd 100644
|
||||||
|
--- a/t/base/lex.t
|
||||||
|
+++ b/t/base/lex.t
|
||||||
|
@@ -1,6 +1,6 @@
|
||||||
|
#!./perl
|
||||||
|
|
||||||
|
-print "1..112\n";
|
||||||
|
+print "1..119\n";
|
||||||
|
|
||||||
|
$x = 'x';
|
||||||
|
|
||||||
|
@@ -154,6 +154,32 @@ my $test = 31;
|
||||||
|
print "not " unless index ($@, 'Can\'t use global $^XYZ in "my"') > -1;
|
||||||
|
print "ok $test\n"; $test++;
|
||||||
|
# print "($@)\n" if $@;
|
||||||
|
+#
|
||||||
|
+ ${^TEST}= "splat";
|
||||||
|
+ @{^TEST}= ("foo", "bar");
|
||||||
|
+ %{^TEST}= ("foo" => "FOO", "bar" => "BAR" );
|
||||||
|
+
|
||||||
|
+ print "not " if "${^TEST}" ne "splat";
|
||||||
|
+ print "ok $test\n"; $test++;
|
||||||
|
+
|
||||||
|
+ print "not " if "${^TEST}[0]" ne "splat[0]";
|
||||||
|
+ print "ok $test\n"; $test++;
|
||||||
|
+
|
||||||
|
+ print "not " if "${^TEST[0]}" ne "foo";
|
||||||
|
+ print "ok $test\n"; $test++;
|
||||||
|
+
|
||||||
|
+ print "not " if "${ ^TEST [1] }" ne "bar";
|
||||||
|
+ print "ok $test\n"; $test++;
|
||||||
|
+
|
||||||
|
+ print "not " if "${^TEST}{foo}" ne "splat{foo}";
|
||||||
|
+ print "ok $test\n"; $test++;
|
||||||
|
+
|
||||||
|
+ print "not " if "${^TEST{foo}}" ne "FOO";
|
||||||
|
+ print "ok $test\n"; $test++;
|
||||||
|
+
|
||||||
|
+ print "not " if "${ ^TEST {bar} }" ne "BAR";
|
||||||
|
+ print "ok $test\n"; $test++;
|
||||||
|
+
|
||||||
|
|
||||||
|
# Now let's make sure that caret variables are all forced into the main package.
|
||||||
|
package Someother;
|
||||||
|
diff --git a/toke.c b/toke.c
|
||||||
|
index ee9c464..aff785b 100644
|
||||||
|
--- a/toke.c
|
||||||
|
+++ b/toke.c
|
||||||
|
@@ -9416,19 +9416,36 @@ S_scan_ident(pTHX_ char *s, char *dest, STRLEN destlen, I32 ck_uni)
|
||||||
|
bool skip;
|
||||||
|
char *s2;
|
||||||
|
/* If we were processing {...} notation then... */
|
||||||
|
- if (isIDFIRST_lazy_if_safe(d, e, is_utf8)) {
|
||||||
|
- /* if it starts as a valid identifier, assume that it is one.
|
||||||
|
- (the later check for } being at the expected point will trap
|
||||||
|
- cases where this doesn't pan out.) */
|
||||||
|
- d += is_utf8 ? UTF8SKIP(d) : 1;
|
||||||
|
- parse_ident(&s, &d, e, 1, is_utf8, TRUE);
|
||||||
|
- *d = '\0';
|
||||||
|
+ if (isIDFIRST_lazy_if_safe(d, e, is_utf8)
|
||||||
|
+ || (!isPRINT(*d) /* isCNTRL(d), plus all non-ASCII */
|
||||||
|
+ && isWORDCHAR(*s))
|
||||||
|
+ ) {
|
||||||
|
+ /* note we have to check for a normal identifier first,
|
||||||
|
+ * as it handles utf8 symbols, and only after that has
|
||||||
|
+ * been ruled out can we look at the caret words */
|
||||||
|
+ if (isIDFIRST_lazy_if_safe(d, e, is_utf8) ) {
|
||||||
|
+ /* if it starts as a valid identifier, assume that it is one.
|
||||||
|
+ (the later check for } being at the expected point will trap
|
||||||
|
+ cases where this doesn't pan out.) */
|
||||||
|
+ d += is_utf8 ? UTF8SKIP(d) : 1;
|
||||||
|
+ parse_ident(&s, &d, e, 1, is_utf8, TRUE);
|
||||||
|
+ *d = '\0';
|
||||||
|
+ }
|
||||||
|
+ else { /* caret word: ${^Foo} ${^CAPTURE[0]} */
|
||||||
|
+ d++;
|
||||||
|
+ while (isWORDCHAR(*s) && d < e) {
|
||||||
|
+ *d++ = *s++;
|
||||||
|
+ }
|
||||||
|
+ if (d >= e)
|
||||||
|
+ Perl_croak(aTHX_ "%s", ident_too_long);
|
||||||
|
+ *d = '\0';
|
||||||
|
+ }
|
||||||
|
tmp_copline = CopLINE(PL_curcop);
|
||||||
|
if (s < PL_bufend && isSPACE(*s)) {
|
||||||
|
s = skipspace(s);
|
||||||
|
}
|
||||||
|
if ((*s == '[' || (*s == '{' && strNE(dest, "sub")))) {
|
||||||
|
- /* ${foo[0]} and ${foo{bar}} notation. */
|
||||||
|
+ /* ${foo[0]} and ${foo{bar}} and ${^CAPTURE[0]} notation. */
|
||||||
|
if (ckWARN(WARN_AMBIGUOUS) && keyword(dest, d - dest, 0)) {
|
||||||
|
const char * const brack =
|
||||||
|
(const char *)
|
||||||
|
@@ -9447,19 +9464,6 @@ S_scan_ident(pTHX_ char *s, char *dest, STRLEN destlen, I32 ck_uni)
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
- /* Handle extended ${^Foo} variables
|
||||||
|
- * 1999-02-27 mjd-perl-patch@plover.com */
|
||||||
|
- else if (! isPRINT(*d) /* isCNTRL(d), plus all non-ASCII */
|
||||||
|
- && isWORDCHAR(*s))
|
||||||
|
- {
|
||||||
|
- d++;
|
||||||
|
- while (isWORDCHAR(*s) && d < e) {
|
||||||
|
- *d++ = *s++;
|
||||||
|
- }
|
||||||
|
- if (d >= e)
|
||||||
|
- Perl_croak(aTHX_ "%s", ident_too_long);
|
||||||
|
- *d = '\0';
|
||||||
|
- }
|
||||||
|
|
||||||
|
if ( !tmp_copline )
|
||||||
|
tmp_copline = CopLINE(PL_curcop);
|
||||||
|
--
|
||||||
|
2.14.3
|
||||||
|
|
|
@ -0,0 +1,45 @@
|
||||||
|
From edea384e57453b0a62de58445eed1fded18c1cca Mon Sep 17 00:00:00 2001
|
||||||
|
From: Yves Orton <demerphq@gmail.com>
|
||||||
|
Date: Thu, 29 Jun 2017 13:20:49 +0200
|
||||||
|
Subject: [PATCH] add an additional test for whitespace tolerance in caret
|
||||||
|
word-vars
|
||||||
|
MIME-Version: 1.0
|
||||||
|
Content-Type: text/plain; charset=UTF-8
|
||||||
|
Content-Transfer-Encoding: 8bit
|
||||||
|
|
||||||
|
Petr Písař: Ported to 5.26.2-RC1.
|
||||||
|
|
||||||
|
Signed-off-by: Petr Písař <ppisar@redhat.com>
|
||||||
|
---
|
||||||
|
t/base/lex.t | 7 +++++--
|
||||||
|
1 file changed, 5 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/t/base/lex.t b/t/base/lex.t
|
||||||
|
index ae17bbd..414aa1f 100644
|
||||||
|
--- a/t/base/lex.t
|
||||||
|
+++ b/t/base/lex.t
|
||||||
|
@@ -1,6 +1,6 @@
|
||||||
|
#!./perl
|
||||||
|
|
||||||
|
-print "1..119\n";
|
||||||
|
+print "1..120\n";
|
||||||
|
|
||||||
|
$x = 'x';
|
||||||
|
|
||||||
|
@@ -158,9 +158,12 @@ my $test = 31;
|
||||||
|
${^TEST}= "splat";
|
||||||
|
@{^TEST}= ("foo", "bar");
|
||||||
|
%{^TEST}= ("foo" => "FOO", "bar" => "BAR" );
|
||||||
|
-
|
||||||
|
+
|
||||||
|
print "not " if "${^TEST}" ne "splat";
|
||||||
|
print "ok $test\n"; $test++;
|
||||||
|
+
|
||||||
|
+ print "not " if "${ ^TEST }" ne "splat";
|
||||||
|
+ print "ok $test\n"; $test++;
|
||||||
|
|
||||||
|
print "not " if "${^TEST}[0]" ne "splat[0]";
|
||||||
|
print "ok $test\n"; $test++;
|
||||||
|
--
|
||||||
|
2.14.3
|
||||||
|
|
|
@ -0,0 +1,90 @@
|
||||||
|
From 3e6e57e89f298f450cbe14c61609f08fc01bf233 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Zefram <zefram@fysh.org>
|
||||||
|
Date: Sat, 16 Dec 2017 05:33:20 +0000
|
||||||
|
Subject: [PATCH] perform system() arg processing before fork
|
||||||
|
MIME-Version: 1.0
|
||||||
|
Content-Type: text/plain; charset=UTF-8
|
||||||
|
Content-Transfer-Encoding: 8bit
|
||||||
|
|
||||||
|
A lot of things can happen when stringifying an argument list: side
|
||||||
|
effects, warnings, exceptions. In the case of system(), these effects
|
||||||
|
should happen in the context of the parent process. The stringification
|
||||||
|
can also depend on which process it happens in, as in the case of
|
||||||
|
$$, and in that case it should also happen in the parent process.
|
||||||
|
Therefore reduce the argument scalars to strings first thing in pp_system.
|
||||||
|
Fixes [perl #121105].
|
||||||
|
|
||||||
|
Petr Písař: Ported to 5.26.2-RC1 from
|
||||||
|
64def2aeaeb63f92dadc6dfa33486c1d7b311963.
|
||||||
|
|
||||||
|
Signed-off-by: Petr Písař <ppisar@redhat.com>
|
||||||
|
---
|
||||||
|
pp_sys.c | 16 ++++++++++------
|
||||||
|
t/op/exec.t | 15 ++++++++++++++-
|
||||||
|
2 files changed, 24 insertions(+), 7 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/pp_sys.c b/pp_sys.c
|
||||||
|
index 87961f1..07e552a 100644
|
||||||
|
--- a/pp_sys.c
|
||||||
|
+++ b/pp_sys.c
|
||||||
|
@@ -4375,14 +4375,18 @@ PP(pp_system)
|
||||||
|
int result;
|
||||||
|
# endif
|
||||||
|
|
||||||
|
+ while (++MARK <= SP) {
|
||||||
|
+ SV *origsv = *MARK;
|
||||||
|
+ STRLEN len;
|
||||||
|
+ char *pv;
|
||||||
|
+ pv = SvPV(origsv, len);
|
||||||
|
+ *MARK = newSVpvn_flags(pv, len,
|
||||||
|
+ (SvFLAGS(origsv) & SVf_UTF8) | SVs_TEMP);
|
||||||
|
+ }
|
||||||
|
+ MARK = ORIGMARK;
|
||||||
|
+
|
||||||
|
if (TAINTING_get) {
|
||||||
|
TAINT_ENV();
|
||||||
|
- while (++MARK <= SP) {
|
||||||
|
- (void)SvPV_nolen_const(*MARK); /* stringify for taint check */
|
||||||
|
- if (TAINT_get)
|
||||||
|
- break;
|
||||||
|
- }
|
||||||
|
- MARK = ORIGMARK;
|
||||||
|
TAINT_PROPER("system");
|
||||||
|
}
|
||||||
|
PERL_FLUSHALL_FOR_CHILD;
|
||||||
|
diff --git a/t/op/exec.t b/t/op/exec.t
|
||||||
|
index 237388b..e29de82 100644
|
||||||
|
--- a/t/op/exec.t
|
||||||
|
+++ b/t/op/exec.t
|
||||||
|
@@ -36,7 +36,7 @@ $ENV{LANGUAGE} = 'C'; # Ditto in GNU.
|
||||||
|
my $Is_VMS = $^O eq 'VMS';
|
||||||
|
my $Is_Win32 = $^O eq 'MSWin32';
|
||||||
|
|
||||||
|
-plan(tests => 34);
|
||||||
|
+plan(tests => 37);
|
||||||
|
|
||||||
|
my $Perl = which_perl();
|
||||||
|
|
||||||
|
@@ -177,6 +177,19 @@ TODO: {
|
||||||
|
"exec failure doesn't terminate process");
|
||||||
|
}
|
||||||
|
|
||||||
|
+package CountRead {
|
||||||
|
+ sub TIESCALAR { bless({ n => 0 }, $_[0]) }
|
||||||
|
+ sub FETCH { ++$_[0]->{n} }
|
||||||
|
+}
|
||||||
|
+my $cr;
|
||||||
|
+tie $cr, "CountRead";
|
||||||
|
+is system($^X, "-e", "exit(\$ARGV[0] eq '1' ? 0 : 1)", $cr), 0,
|
||||||
|
+ "system args have magic processed exactly once";
|
||||||
|
+is tied($cr)->{n}, 1, "system args have magic processed before fork";
|
||||||
|
+
|
||||||
|
+is system($^X, "-e", "exit(\$ARGV[0] eq \$ARGV[1] ? 0 : 1)", "$$", $$), 0,
|
||||||
|
+ "system args have magic processed before fork";
|
||||||
|
+
|
||||||
|
my $test = curr_test();
|
||||||
|
exec $Perl, '-le', qq{${quote}print 'ok $test - exec PROG, LIST'${quote}};
|
||||||
|
fail("This should never be reached if the exec() worked");
|
||||||
|
--
|
||||||
|
2.14.3
|
||||||
|
|
|
@ -0,0 +1,35 @@
|
||||||
|
From 7714b11d11da2bfd0dc11638e9dd6836b6a32e90 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Karl Williamson <khw@cpan.org>
|
||||||
|
Date: Mon, 11 Jun 2018 13:26:24 -0600
|
||||||
|
Subject: [PATCH] perl.h: Add parens around macro arguments
|
||||||
|
MIME-Version: 1.0
|
||||||
|
Content-Type: text/plain; charset=UTF-8
|
||||||
|
Content-Transfer-Encoding: 8bit
|
||||||
|
|
||||||
|
Arguments used within macros need to be parenthesized in case they are
|
||||||
|
called with an expression. This commit changes
|
||||||
|
_CHECK_AND_OUTPUT_WIDE_LOCALE_UTF8_MSG() to do that.
|
||||||
|
|
||||||
|
Petr Písař: Ported to 5.26.2 from upstream ff58ca57f844 commit.
|
||||||
|
|
||||||
|
Signed-off-by: Petr Písař <ppisar@redhat.com>
|
||||||
|
---
|
||||||
|
perl.h | 2 +-
|
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/perl.h b/perl.h
|
||||||
|
index 1c613bc..d278c2a 100644
|
||||||
|
--- a/perl.h
|
||||||
|
+++ b/perl.h
|
||||||
|
@@ -5980,7 +5980,7 @@ typedef struct am_table_short AMTS;
|
||||||
|
# define _CHECK_AND_OUTPUT_WIDE_LOCALE_UTF8_MSG(s, send) \
|
||||||
|
STMT_START { /* Check if to warn before doing the conversion work */\
|
||||||
|
if (! PL_in_utf8_CTYPE_locale && ckWARN(WARN_LOCALE)) { \
|
||||||
|
- UV cp = utf8_to_uvchr_buf((U8 *) s, (U8 *) send, NULL); \
|
||||||
|
+ UV cp = utf8_to_uvchr_buf((U8 *) (s), (U8 *) (send), NULL); \
|
||||||
|
Perl_warner(aTHX_ packWARN(WARN_LOCALE), \
|
||||||
|
"Wide character (U+%" UVXf ") in %s", \
|
||||||
|
(cp == 0) \
|
||||||
|
--
|
||||||
|
2.14.4
|
||||||
|
|
|
@ -1,28 +1,23 @@
|
||||||
From 897d1f7fd515b828e4b198d8b8bef76c6faf03ed Mon Sep 17 00:00:00 2001
|
From 208dea486fa24081cbc0cf05fa5a15c802e2bc68 Mon Sep 17 00:00:00 2001
|
||||||
From: John Lightsey <jd@cpanel.net>
|
From: John Lightsey <jd@cpanel.net>
|
||||||
Date: Wed, 20 Nov 2019 20:02:45 -0600
|
Date: Wed, 20 Nov 2019 20:02:45 -0600
|
||||||
Subject: [PATCH] regcomp.c: Prevent integer overflow from nested regex
|
Subject: [PATCH v528 1/3] regcomp.c: Prevent integer overflow from nested
|
||||||
quantifiers.
|
regex quantifiers.
|
||||||
MIME-Version: 1.0
|
|
||||||
Content-Type: text/plain; charset=UTF-8
|
|
||||||
Content-Transfer-Encoding: 8bit
|
|
||||||
|
|
||||||
(CVE-2020-10543) On 32bit systems the size calculations for nested regular
|
(CVE-2020-10543) On 32bit systems the size calculations for nested regular
|
||||||
expression quantifiers could overflow causing heap memory corruption.
|
expression quantifiers could overflow causing heap memory corruption.
|
||||||
|
|
||||||
Fixes: Perl/perl5-security#125
|
Fixes: Perl/perl5-security#125
|
||||||
(cherry picked from commit bfd31397db5dc1a5c5d3e0a1f753a4f89a736e71)
|
|
||||||
Signed-off-by: Petr Písař <ppisar@redhat.com>
|
|
||||||
---
|
---
|
||||||
regcomp.c | 6 ++++++
|
regcomp.c | 6 ++++++
|
||||||
1 file changed, 6 insertions(+)
|
1 file changed, 6 insertions(+)
|
||||||
|
|
||||||
diff --git a/regcomp.c b/regcomp.c
|
diff --git a/regcomp.c b/regcomp.c
|
||||||
index 93c8d98fbb..5f86be8086 100644
|
index e1da15a77c..dd18add1db 100644
|
||||||
--- a/regcomp.c
|
--- a/regcomp.c
|
||||||
+++ b/regcomp.c
|
+++ b/regcomp.c
|
||||||
@@ -5489,6 +5489,12 @@ S_study_chunk(pTHX_ RExC_state_t *pRExC_state, regnode **scanp,
|
@@ -5102,6 +5139,12 @@ S_study_chunk(pTHX_ RExC_state_t *pRExC_state, regnode **scanp,
|
||||||
RExC_precomp)));
|
(void)ReREFCNT_inc(RExC_rx_sv);
|
||||||
}
|
}
|
||||||
|
|
||||||
+ if ( ( minnext > 0 && mincount >= SSize_t_MAX / minnext )
|
+ if ( ( minnext > 0 && mincount >= SSize_t_MAX / minnext )
|
||||||
|
@ -35,5 +30,5 @@ index 93c8d98fbb..5f86be8086 100644
|
||||||
is_inf_internal |= deltanext == SSize_t_MAX
|
is_inf_internal |= deltanext == SSize_t_MAX
|
||||||
|| (maxcount == REG_INFTY && minnext + deltanext > 0);
|
|| (maxcount == REG_INFTY && minnext + deltanext > 0);
|
||||||
--
|
--
|
||||||
2.25.4
|
2.20.1
|
||||||
|
|
|
@ -1,15 +1,9 @@
|
||||||
From 0a320d753fe7fca03df259a4dfd8e641e51edaa8 Mon Sep 17 00:00:00 2001
|
From a3a7598c8ec6efb0eb9c0b786d80c4d2a3751b70 Mon Sep 17 00:00:00 2001
|
||||||
From: Hugo van der Sanden <hv@crypt.org>
|
From: Hugo van der Sanden <hv@crypt.org>
|
||||||
Date: Tue, 18 Feb 2020 13:51:16 +0000
|
Date: Tue, 18 Feb 2020 13:51:16 +0000
|
||||||
Subject: [PATCH 1/2] study_chunk: extract rck_elide_nothing
|
Subject: [PATCH v528 2/3] study_chunk: extract rck_elide_nothing
|
||||||
MIME-Version: 1.0
|
|
||||||
Content-Type: text/plain; charset=UTF-8
|
|
||||||
Content-Transfer-Encoding: 8bit
|
|
||||||
|
|
||||||
(CVE-2020-10878)
|
(CVE-2020-10878)
|
||||||
|
|
||||||
(cherry picked from commit 93dee06613d4e1428fb10905ce1c3c96f53113dc)
|
|
||||||
Signed-off-by: Petr Písař <ppisar@redhat.com>
|
|
||||||
---
|
---
|
||||||
embed.fnc | 1 +
|
embed.fnc | 1 +
|
||||||
embed.h | 1 +
|
embed.h | 1 +
|
||||||
|
@ -18,34 +12,34 @@ Signed-off-by: Petr Písař <ppisar@redhat.com>
|
||||||
4 files changed, 48 insertions(+), 27 deletions(-)
|
4 files changed, 48 insertions(+), 27 deletions(-)
|
||||||
|
|
||||||
diff --git a/embed.fnc b/embed.fnc
|
diff --git a/embed.fnc b/embed.fnc
|
||||||
index aedb4baef1..d7cd04d3fc 100644
|
index e762fe1eec..cf89277163 100644
|
||||||
--- a/embed.fnc
|
--- a/embed.fnc
|
||||||
+++ b/embed.fnc
|
+++ b/embed.fnc
|
||||||
@@ -2481,6 +2481,7 @@ Es |SSize_t|study_chunk |NN RExC_state_t *pRExC_state \
|
@@ -2398,6 +2398,7 @@ Es |SSize_t|study_chunk |NN RExC_state_t *pRExC_state \
|
||||||
|I32 stopparen|U32 recursed_depth \
|
|I32 stopparen|U32 recursed_depth \
|
||||||
|NULLOK regnode_ssc *and_withp \
|
|NULLOK regnode_ssc *and_withp \
|
||||||
|U32 flags|U32 depth
|
|U32 flags|U32 depth|bool was_mutate_ok
|
||||||
+Es |void |rck_elide_nothing|NN regnode *node
|
+Es |void |rck_elide_nothing|NN regnode *node
|
||||||
EsR |SV * |get_ANYOFM_contents|NN const regnode * n
|
|
||||||
EsRn |U32 |add_data |NN RExC_state_t* const pRExC_state \
|
EsRn |U32 |add_data |NN RExC_state_t* const pRExC_state \
|
||||||
|NN const char* const s|const U32 n
|
|NN const char* const s|const U32 n
|
||||||
|
rs |void |re_croak2 |bool utf8|NN const char* pat1|NN const char* pat2|...
|
||||||
diff --git a/embed.h b/embed.h
|
diff --git a/embed.h b/embed.h
|
||||||
index 75c91f77f4..356a8b98d9 100644
|
index a5416a1148..886551ce5c 100644
|
||||||
--- a/embed.h
|
--- a/embed.h
|
||||||
+++ b/embed.h
|
+++ b/embed.h
|
||||||
@@ -1208,6 +1208,7 @@
|
@@ -1046,6 +1046,7 @@
|
||||||
|
#define output_or_return_posix_warnings(a,b,c) S_output_or_return_posix_warnings(aTHX_ a,b,c)
|
||||||
#define parse_lparen_question_flags(a) S_parse_lparen_question_flags(aTHX_ a)
|
#define parse_lparen_question_flags(a) S_parse_lparen_question_flags(aTHX_ a)
|
||||||
#define parse_uniprop_string(a,b,c,d,e,f,g,h,i) Perl_parse_uniprop_string(aTHX_ a,b,c,d,e,f,g,h,i)
|
|
||||||
#define populate_ANYOF_from_invlist(a,b) S_populate_ANYOF_from_invlist(aTHX_ a,b)
|
#define populate_ANYOF_from_invlist(a,b) S_populate_ANYOF_from_invlist(aTHX_ a,b)
|
||||||
+#define rck_elide_nothing(a) S_rck_elide_nothing(aTHX_ a)
|
+#define rck_elide_nothing(a) S_rck_elide_nothing(aTHX_ a)
|
||||||
#define reg(a,b,c,d) S_reg(aTHX_ a,b,c,d)
|
#define reg(a,b,c,d) S_reg(aTHX_ a,b,c,d)
|
||||||
#define reg2Lanode(a,b,c,d) S_reg2Lanode(aTHX_ a,b,c,d)
|
#define reg2Lanode(a,b,c,d) S_reg2Lanode(aTHX_ a,b,c,d)
|
||||||
#define reg_node(a,b) S_reg_node(aTHX_ a,b)
|
#define reg_node(a,b) S_reg_node(aTHX_ a,b)
|
||||||
diff --git a/proto.h b/proto.h
|
diff --git a/proto.h b/proto.h
|
||||||
index 141ddbaee6..f316fe134e 100644
|
index 66bb29b132..d3f8802c1d 100644
|
||||||
--- a/proto.h
|
--- a/proto.h
|
||||||
+++ b/proto.h
|
+++ b/proto.h
|
||||||
@@ -5543,6 +5543,9 @@ PERL_CALLCONV SV * Perl_parse_uniprop_string(pTHX_ const char * const name, cons
|
@@ -5150,6 +5150,9 @@ STATIC void S_parse_lparen_question_flags(pTHX_ RExC_state_t *pRExC_state);
|
||||||
STATIC void S_populate_ANYOF_from_invlist(pTHX_ regnode *node, SV** invlist_ptr);
|
STATIC void S_populate_ANYOF_from_invlist(pTHX_ regnode *node, SV** invlist_ptr);
|
||||||
#define PERL_ARGS_ASSERT_POPULATE_ANYOF_FROM_INVLIST \
|
#define PERL_ARGS_ASSERT_POPULATE_ANYOF_FROM_INVLIST \
|
||||||
assert(node); assert(invlist_ptr)
|
assert(node); assert(invlist_ptr)
|
||||||
|
@ -56,10 +50,10 @@ index 141ddbaee6..f316fe134e 100644
|
||||||
__attribute__noreturn__;
|
__attribute__noreturn__;
|
||||||
#define PERL_ARGS_ASSERT_RE_CROAK2 \
|
#define PERL_ARGS_ASSERT_RE_CROAK2 \
|
||||||
diff --git a/regcomp.c b/regcomp.c
|
diff --git a/regcomp.c b/regcomp.c
|
||||||
index 5f86be8086..4ba2980db6 100644
|
index dd18add1db..0a9c6a8085 100644
|
||||||
--- a/regcomp.c
|
--- a/regcomp.c
|
||||||
+++ b/regcomp.c
|
+++ b/regcomp.c
|
||||||
@@ -4450,6 +4450,44 @@ S_unwind_scan_frames(pTHX_ const void *p)
|
@@ -4094,6 +4094,43 @@ S_unwind_scan_frames(pTHX_ const void *p)
|
||||||
} while (f);
|
} while (f);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -100,12 +94,11 @@ index 5f86be8086..4ba2980db6 100644
|
||||||
+ }
|
+ }
|
||||||
+ return;
|
+ return;
|
||||||
+}
|
+}
|
||||||
+
|
|
||||||
/* the return from this sub is the minimum length that could possibly match */
|
|
||||||
STATIC SSize_t
|
STATIC SSize_t
|
||||||
S_study_chunk(pTHX_ RExC_state_t *pRExC_state, regnode **scanp,
|
S_study_chunk(pTHX_ RExC_state_t *pRExC_state, regnode **scanp,
|
||||||
@@ -4550,28 +4588,10 @@ S_study_chunk(pTHX_ RExC_state_t *pRExC_state, regnode **scanp,
|
@@ -4197,28 +4234,10 @@ S_study_chunk(pTHX_ RExC_state_t *pRExC_state, regnode **scanp,
|
||||||
*/
|
if (mutate_ok)
|
||||||
JOIN_EXACT(scan,&min_subtract, &unfolded_multi_char, 0);
|
JOIN_EXACT(scan,&min_subtract, &unfolded_multi_char, 0);
|
||||||
|
|
||||||
- /* Follow the next-chain of the current node and optimize
|
- /* Follow the next-chain of the current node and optimize
|
||||||
|
@ -137,7 +130,7 @@ index 5f86be8086..4ba2980db6 100644
|
||||||
|
|
||||||
/* The principal pseudo-switch. Cannot be a switch, since we
|
/* The principal pseudo-switch. Cannot be a switch, since we
|
||||||
look into several different things. */
|
look into several different things. */
|
||||||
@@ -5745,11 +5765,7 @@ Perl_re_printf( aTHX_ "LHS=%" UVuf " RHS=%" UVuf "\n",
|
@@ -5348,11 +5367,7 @@ Perl_re_printf( aTHX_ "LHS=%" UVuf " RHS=%" UVuf "\n",
|
||||||
if (data && (fl & SF_HAS_EVAL))
|
if (data && (fl & SF_HAS_EVAL))
|
||||||
data->flags |= SF_HAS_EVAL;
|
data->flags |= SF_HAS_EVAL;
|
||||||
optimize_curly_tail:
|
optimize_curly_tail:
|
||||||
|
@ -151,5 +144,5 @@ index 5f86be8086..4ba2980db6 100644
|
||||||
|
|
||||||
default:
|
default:
|
||||||
--
|
--
|
||||||
2.25.4
|
2.20.1
|
||||||
|
|
|
@ -1,47 +1,40 @@
|
||||||
From 783ddef8fc74b00cde72898c2c3228853dc82d91 Mon Sep 17 00:00:00 2001
|
From c031e3ec7c713077659f5f7dc6638d926c69d7b2 Mon Sep 17 00:00:00 2001
|
||||||
From: Hugo van der Sanden <hv@crypt.org>
|
From: Hugo van der Sanden <hv@crypt.org>
|
||||||
Date: Sat, 11 Apr 2020 14:10:24 +0100
|
Date: Sat, 11 Apr 2020 14:10:24 +0100
|
||||||
Subject: [PATCH] study_chunk: avoid mutating regexp program within GOSUB
|
Subject: [PATCH v528 3/3] study_chunk: avoid mutating regexp program within
|
||||||
MIME-Version: 1.0
|
GOSUB
|
||||||
Content-Type: text/plain; charset=UTF-8
|
|
||||||
Content-Transfer-Encoding: 8bit
|
|
||||||
|
|
||||||
gh16947 and gh17743: studying GOSUB may restudy in an inner call
|
gh16947 and gh17743: studying GOSUB may restudy in an inner call
|
||||||
(via a mix of recursion and enframing) something that an outer call
|
(via a mix of recursion and enframing) something that an outer call
|
||||||
is in the middle of looking at. Let the outer frame deal with it.
|
is in the middle of looking at. Let the outer frame deal with it.
|
||||||
|
|
||||||
(CVE-2020-12723)
|
(CVE-2020-12723)
|
||||||
|
|
||||||
(cherry picked from commit c4033e740bd18d9fbe3456a9db2ec2053cdc5271)
|
|
||||||
Petr Písař: Ported to 5.30.1 from
|
|
||||||
66bbb51b93253a3f87d11c2695cfb7bdb782184a.
|
|
||||||
Signed-off-by: Petr Písař <ppisar@redhat.com>
|
|
||||||
---
|
---
|
||||||
embed.fnc | 2 +-
|
embed.fnc | 2 +-
|
||||||
embed.h | 2 +-
|
embed.h | 2 +-
|
||||||
proto.h | 2 +-
|
proto.h | 2 +-
|
||||||
regcomp.c | 54 +++++++++++++++++++++++++++++++++++-------------------
|
regcomp.c | 48 ++++++++++++++++++++++++++++++++----------------
|
||||||
t/re/pat.t | 26 +++++++++++++++++++++++++-
|
t/re/pat.t | 26 +++++++++++++++++++++++++-
|
||||||
5 files changed, 63 insertions(+), 23 deletions(-)
|
5 files changed, 60 insertions(+), 20 deletions(-)
|
||||||
|
|
||||||
diff --git a/embed.fnc b/embed.fnc
|
diff --git a/embed.fnc b/embed.fnc
|
||||||
index 1b9cf54..d0463e4 100644
|
index cf89277163..4b1ba28277 100644
|
||||||
--- a/embed.fnc
|
--- a/embed.fnc
|
||||||
+++ b/embed.fnc
|
+++ b/embed.fnc
|
||||||
@@ -2482,7 +2482,7 @@ Es |SSize_t|study_chunk |NN RExC_state_t *pRExC_state \
|
@@ -2397,7 +2397,7 @@ Es |SSize_t|study_chunk |NN RExC_state_t *pRExC_state \
|
||||||
|NULLOK struct scan_data_t *data \
|
|NULLOK struct scan_data_t *data \
|
||||||
|I32 stopparen|U32 recursed_depth \
|
|I32 stopparen|U32 recursed_depth \
|
||||||
|NULLOK regnode_ssc *and_withp \
|
|NULLOK regnode_ssc *and_withp \
|
||||||
- |U32 flags|U32 depth
|
- |U32 flags|U32 depth
|
||||||
+ |U32 flags|U32 depth|bool was_mutate_ok
|
+ |U32 flags|U32 depth|bool was_mutate_ok
|
||||||
Es |void |rck_elide_nothing|NN regnode *node
|
|
||||||
EsR |SV * |get_ANYOFM_contents|NN const regnode * n
|
|
||||||
EsRn |U32 |add_data |NN RExC_state_t* const pRExC_state \
|
EsRn |U32 |add_data |NN RExC_state_t* const pRExC_state \
|
||||||
|
|NN const char* const s|const U32 n
|
||||||
|
rs |void |re_croak2 |bool utf8|NN const char* pat1|NN const char* pat2|...
|
||||||
diff --git a/embed.h b/embed.h
|
diff --git a/embed.h b/embed.h
|
||||||
index cf44011..72c2a8e 100644
|
index 886551ce5c..50fcabc140 100644
|
||||||
--- a/embed.h
|
--- a/embed.h
|
||||||
+++ b/embed.h
|
+++ b/embed.h
|
||||||
@@ -1239,7 +1239,7 @@
|
@@ -1075,7 +1075,7 @@
|
||||||
#define ssc_is_cp_posixl_init S_ssc_is_cp_posixl_init
|
#define ssc_is_cp_posixl_init S_ssc_is_cp_posixl_init
|
||||||
#define ssc_or(a,b,c) S_ssc_or(aTHX_ a,b,c)
|
#define ssc_or(a,b,c) S_ssc_or(aTHX_ a,b,c)
|
||||||
#define ssc_union(a,b,c) S_ssc_union(aTHX_ a,b,c)
|
#define ssc_union(a,b,c) S_ssc_union(aTHX_ a,b,c)
|
||||||
|
@ -51,10 +44,10 @@ index cf44011..72c2a8e 100644
|
||||||
# if defined(PERL_IN_REGCOMP_C) || defined (PERL_IN_DUMP_C)
|
# if defined(PERL_IN_REGCOMP_C) || defined (PERL_IN_DUMP_C)
|
||||||
#define _invlist_dump(a,b,c,d) Perl__invlist_dump(aTHX_ a,b,c,d)
|
#define _invlist_dump(a,b,c,d) Perl__invlist_dump(aTHX_ a,b,c,d)
|
||||||
diff --git a/proto.h b/proto.h
|
diff --git a/proto.h b/proto.h
|
||||||
index ee74153..9a3ce27 100644
|
index d3f8802c1d..e276f69bd1 100644
|
||||||
--- a/proto.h
|
--- a/proto.h
|
||||||
+++ b/proto.h
|
+++ b/proto.h
|
||||||
@@ -5671,7 +5671,7 @@ PERL_STATIC_INLINE void S_ssc_union(pTHX_ regnode_ssc *ssc, SV* const invlist, c
|
@@ -5258,7 +5258,7 @@ PERL_STATIC_INLINE void S_ssc_union(pTHX_ regnode_ssc *ssc, SV* const invlist, c
|
||||||
#define PERL_ARGS_ASSERT_SSC_UNION \
|
#define PERL_ARGS_ASSERT_SSC_UNION \
|
||||||
assert(ssc); assert(invlist)
|
assert(ssc); assert(invlist)
|
||||||
#endif
|
#endif
|
||||||
|
@ -64,18 +57,18 @@ index ee74153..9a3ce27 100644
|
||||||
assert(pRExC_state); assert(scanp); assert(minlenp); assert(deltap); assert(last)
|
assert(pRExC_state); assert(scanp); assert(minlenp); assert(deltap); assert(last)
|
||||||
#endif
|
#endif
|
||||||
diff --git a/regcomp.c b/regcomp.c
|
diff --git a/regcomp.c b/regcomp.c
|
||||||
index b101752..b9ea2a0 100644
|
index 0a9c6a8085..e66032a16a 100644
|
||||||
--- a/regcomp.c
|
--- a/regcomp.c
|
||||||
+++ b/regcomp.c
|
+++ b/regcomp.c
|
||||||
@@ -106,6 +106,7 @@ typedef struct scan_frame {
|
@@ -110,6 +110,7 @@ typedef struct scan_frame {
|
||||||
regnode *next_regnode; /* next node to process when last is reached */
|
regnode *next_regnode; /* next node to process when last is reached */
|
||||||
U32 prev_recursed_depth;
|
U32 prev_recursed_depth;
|
||||||
I32 stopparen; /* what stopparen do we use */
|
I32 stopparen; /* what stopparen do we use */
|
||||||
+ bool in_gosub; /* this or an outer frame is for GOSUB */
|
+ bool in_gosub; /* this or an outer frame is for GOSUB */
|
||||||
|
U32 is_top_frame; /* what flags do we use? */
|
||||||
|
|
||||||
struct scan_frame *this_prev_frame; /* this previous frame */
|
struct scan_frame *this_prev_frame; /* this previous frame */
|
||||||
struct scan_frame *prev_frame; /* previous frame */
|
@@ -4102,7 +4103,7 @@ S_study_chunk(pTHX_ RExC_state_t *pRExC_state, regnode **scanp,
|
||||||
@@ -4475,7 +4476,7 @@ S_study_chunk(pTHX_ RExC_state_t *pRExC_state, regnode **scanp,
|
|
||||||
I32 stopparen,
|
I32 stopparen,
|
||||||
U32 recursed_depth,
|
U32 recursed_depth,
|
||||||
regnode_ssc *and_withp,
|
regnode_ssc *and_withp,
|
||||||
|
@ -84,7 +77,7 @@ index b101752..b9ea2a0 100644
|
||||||
/* scanp: Start here (read-write). */
|
/* scanp: Start here (read-write). */
|
||||||
/* deltap: Write maxlen-minlen here. */
|
/* deltap: Write maxlen-minlen here. */
|
||||||
/* last: Stop before this one. */
|
/* last: Stop before this one. */
|
||||||
@@ -4554,6 +4555,10 @@ S_study_chunk(pTHX_ RExC_state_t *pRExC_state, regnode **scanp,
|
@@ -4179,6 +4180,10 @@ S_study_chunk(pTHX_ RExC_state_t *pRExC_state, regnode **scanp,
|
||||||
node length to get a real minimum (because
|
node length to get a real minimum (because
|
||||||
the folded version may be shorter) */
|
the folded version may be shorter) */
|
||||||
bool unfolded_multi_char = FALSE;
|
bool unfolded_multi_char = FALSE;
|
||||||
|
@ -93,9 +86,9 @@ index b101752..b9ea2a0 100644
|
||||||
+ */
|
+ */
|
||||||
+ bool mutate_ok = was_mutate_ok && !(frame && frame->in_gosub);
|
+ bool mutate_ok = was_mutate_ok && !(frame && frame->in_gosub);
|
||||||
/* Peephole optimizer: */
|
/* Peephole optimizer: */
|
||||||
DEBUG_STUDYDATA("Peep", data, depth, is_inf);
|
DEBUG_STUDYDATA("Peep:", data, depth);
|
||||||
DEBUG_PEEP("Peep", scan, depth, flags);
|
DEBUG_PEEP("Peep", scan, depth);
|
||||||
@@ -4564,7 +4569,8 @@ S_study_chunk(pTHX_ RExC_state_t *pRExC_state, regnode **scanp,
|
@@ -4189,7 +4194,8 @@ S_study_chunk(pTHX_ RExC_state_t *pRExC_state, regnode **scanp,
|
||||||
* parsing code, as each (?:..) is handled by a different invocation of
|
* parsing code, as each (?:..) is handled by a different invocation of
|
||||||
* reg() -- Yves
|
* reg() -- Yves
|
||||||
*/
|
*/
|
||||||
|
@ -104,9 +97,9 @@ index b101752..b9ea2a0 100644
|
||||||
+ JOIN_EXACT(scan,&min_subtract, &unfolded_multi_char, 0);
|
+ JOIN_EXACT(scan,&min_subtract, &unfolded_multi_char, 0);
|
||||||
|
|
||||||
/* Follow the next-chain of the current node and optimize
|
/* Follow the next-chain of the current node and optimize
|
||||||
away all the NOTHINGs from it.
|
away all the NOTHINGs from it. */
|
||||||
@@ -4596,7 +4602,7 @@ S_study_chunk(pTHX_ RExC_state_t *pRExC_state, regnode **scanp,
|
@@ -4238,7 +4244,7 @@ S_study_chunk(pTHX_ RExC_state_t *pRExC_state, regnode **scanp,
|
||||||
/* DEFINEP study_chunk() recursion */
|
* NOTE we dont use the return here! */
|
||||||
(void)study_chunk(pRExC_state, &scan, &minlen,
|
(void)study_chunk(pRExC_state, &scan, &minlen,
|
||||||
&deltanext, next, &data_fake, stopparen,
|
&deltanext, next, &data_fake, stopparen,
|
||||||
- recursed_depth, NULL, f, depth+1);
|
- recursed_depth, NULL, f, depth+1);
|
||||||
|
@ -114,8 +107,8 @@ index b101752..b9ea2a0 100644
|
||||||
|
|
||||||
scan = next;
|
scan = next;
|
||||||
} else
|
} else
|
||||||
@@ -4664,7 +4670,8 @@ S_study_chunk(pTHX_ RExC_state_t *pRExC_state, regnode **scanp,
|
@@ -4305,7 +4311,8 @@ S_study_chunk(pTHX_ RExC_state_t *pRExC_state, regnode **scanp,
|
||||||
/* recurse study_chunk() for each BRANCH in an alternation */
|
/* we suppose the run is continuous, last=next...*/
|
||||||
minnext = study_chunk(pRExC_state, &scan, minlenp,
|
minnext = study_chunk(pRExC_state, &scan, minlenp,
|
||||||
&deltanext, next, &data_fake, stopparen,
|
&deltanext, next, &data_fake, stopparen,
|
||||||
- recursed_depth, NULL, f,depth+1);
|
- recursed_depth, NULL, f,depth+1);
|
||||||
|
@ -124,7 +117,7 @@ index b101752..b9ea2a0 100644
|
||||||
|
|
||||||
if (min1 > minnext)
|
if (min1 > minnext)
|
||||||
min1 = minnext;
|
min1 = minnext;
|
||||||
@@ -4731,9 +4738,10 @@ S_study_chunk(pTHX_ RExC_state_t *pRExC_state, regnode **scanp,
|
@@ -4372,9 +4379,10 @@ S_study_chunk(pTHX_ RExC_state_t *pRExC_state, regnode **scanp,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -138,7 +131,7 @@ index b101752..b9ea2a0 100644
|
||||||
/* demq.
|
/* demq.
|
||||||
|
|
||||||
Assuming this was/is a branch we are dealing with: 'scan'
|
Assuming this was/is a branch we are dealing with: 'scan'
|
||||||
@@ -5188,6 +5196,9 @@ S_study_chunk(pTHX_ RExC_state_t *pRExC_state, regnode **scanp,
|
@@ -4825,6 +4833,9 @@ S_study_chunk(pTHX_ RExC_state_t *pRExC_state, regnode **scanp,
|
||||||
newframe->stopparen = stopparen;
|
newframe->stopparen = stopparen;
|
||||||
newframe->prev_recursed_depth = recursed_depth;
|
newframe->prev_recursed_depth = recursed_depth;
|
||||||
newframe->this_prev_frame= frame;
|
newframe->this_prev_frame= frame;
|
||||||
|
@ -146,30 +139,9 @@ index b101752..b9ea2a0 100644
|
||||||
+ (frame && frame->in_gosub) || OP(scan) == GOSUB
|
+ (frame && frame->in_gosub) || OP(scan) == GOSUB
|
||||||
+ );
|
+ );
|
||||||
|
|
||||||
DEBUG_STUDYDATA("frame-new", data, depth, is_inf);
|
DEBUG_STUDYDATA("frame-new:",data,depth);
|
||||||
DEBUG_PEEP("fnew", scan, depth, flags);
|
DEBUG_PEEP("fnew", scan, depth);
|
||||||
@@ -5345,7 +5356,7 @@ S_study_chunk(pTHX_ RExC_state_t *pRExC_state, regnode **scanp,
|
@@ -5043,7 +5054,7 @@ S_study_chunk(pTHX_ RExC_state_t *pRExC_state, regnode **scanp,
|
||||||
|
|
||||||
/* This temporary node can now be turned into EXACTFU, and
|
|
||||||
* must, as regexec.c doesn't handle it */
|
|
||||||
- if (OP(next) == EXACTFU_S_EDGE) {
|
|
||||||
+ if (OP(next) == EXACTFU_S_EDGE && mutate_ok) {
|
|
||||||
OP(next) = EXACTFU;
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -5353,8 +5364,9 @@ S_study_chunk(pTHX_ RExC_state_t *pRExC_state, regnode **scanp,
|
|
||||||
&& isALPHA_A(* STRING(next))
|
|
||||||
&& ( OP(next) == EXACTFAA
|
|
||||||
|| ( OP(next) == EXACTFU
|
|
||||||
- && ! HAS_NONLATIN1_SIMPLE_FOLD_CLOSURE(* STRING(next)))))
|
|
||||||
- {
|
|
||||||
+ && ! HAS_NONLATIN1_SIMPLE_FOLD_CLOSURE(* STRING(next))))
|
|
||||||
+ && mutate_ok
|
|
||||||
+ ) {
|
|
||||||
/* These differ in just one bit */
|
|
||||||
U8 mask = ~ ('A' ^ 'a');
|
|
||||||
|
|
||||||
@@ -5441,7 +5453,7 @@ S_study_chunk(pTHX_ RExC_state_t *pRExC_state, regnode **scanp,
|
|
||||||
(mincount == 0
|
(mincount == 0
|
||||||
? (f & ~SCF_DO_SUBSTR)
|
? (f & ~SCF_DO_SUBSTR)
|
||||||
: f)
|
: f)
|
||||||
|
@ -178,7 +150,7 @@ index b101752..b9ea2a0 100644
|
||||||
|
|
||||||
if (flags & SCF_DO_STCLASS)
|
if (flags & SCF_DO_STCLASS)
|
||||||
data->start_class = oclass;
|
data->start_class = oclass;
|
||||||
@@ -5507,7 +5519,9 @@ S_study_chunk(pTHX_ RExC_state_t *pRExC_state, regnode **scanp,
|
@@ -5105,7 +5116,9 @@ S_study_chunk(pTHX_ RExC_state_t *pRExC_state, regnode **scanp,
|
||||||
if ( OP(oscan) == CURLYX && data
|
if ( OP(oscan) == CURLYX && data
|
||||||
&& data->flags & SF_IN_PAR
|
&& data->flags & SF_IN_PAR
|
||||||
&& !(data->flags & SF_HAS_EVAL)
|
&& !(data->flags & SF_HAS_EVAL)
|
||||||
|
@ -189,7 +161,7 @@ index b101752..b9ea2a0 100644
|
||||||
/* Try to optimize to CURLYN. */
|
/* Try to optimize to CURLYN. */
|
||||||
regnode *nxt = NEXTOPER(oscan) + EXTRA_STEP_2ARGS;
|
regnode *nxt = NEXTOPER(oscan) + EXTRA_STEP_2ARGS;
|
||||||
regnode * const nxt1 = nxt;
|
regnode * const nxt1 = nxt;
|
||||||
@@ -5557,10 +5571,10 @@ S_study_chunk(pTHX_ RExC_state_t *pRExC_state, regnode **scanp,
|
@@ -5151,10 +5164,10 @@ S_study_chunk(pTHX_ RExC_state_t *pRExC_state, regnode **scanp,
|
||||||
&& !(data->flags & SF_HAS_EVAL)
|
&& !(data->flags & SF_HAS_EVAL)
|
||||||
&& !deltanext /* atom is fixed width */
|
&& !deltanext /* atom is fixed width */
|
||||||
&& minnext != 0 /* CURLYM can't handle zero width */
|
&& minnext != 0 /* CURLYM can't handle zero width */
|
||||||
|
@ -201,36 +173,37 @@ index b101752..b9ea2a0 100644
|
||||||
) {
|
) {
|
||||||
/* XXXX How to optimize if data == 0? */
|
/* XXXX How to optimize if data == 0? */
|
||||||
/* Optimize to a simpler form. */
|
/* Optimize to a simpler form. */
|
||||||
@@ -5613,7 +5627,7 @@ S_study_chunk(pTHX_ RExC_state_t *pRExC_state, regnode **scanp,
|
@@ -5201,7 +5214,8 @@ S_study_chunk(pTHX_ RExC_state_t *pRExC_state, regnode **scanp,
|
||||||
/* recurse study_chunk() on optimised CURLYX => CURLYM */
|
#endif
|
||||||
|
/* Optimize again: */
|
||||||
study_chunk(pRExC_state, &nxt1, minlenp, &deltanext, nxt,
|
study_chunk(pRExC_state, &nxt1, minlenp, &deltanext, nxt,
|
||||||
NULL, stopparen, recursed_depth, NULL, 0,
|
- NULL, stopparen, recursed_depth, NULL, 0,depth+1);
|
||||||
- depth+1);
|
+ NULL, stopparen, recursed_depth, NULL, 0,
|
||||||
+ depth+1, mutate_ok);
|
+ depth+1, mutate_ok);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
oscan->flags = 0;
|
oscan->flags = 0;
|
||||||
@@ -6018,7 +6032,8 @@ Perl_re_printf( aTHX_ "LHS=%" UVuf " RHS=%" UVuf "\n",
|
@@ -5592,7 +5606,8 @@ Perl_re_printf( aTHX_ "LHS=%" UVuf " RHS=%" UVuf "\n",
|
||||||
/* recurse study_chunk() for lookahead body */
|
nscan = NEXTOPER(NEXTOPER(scan));
|
||||||
minnext = study_chunk(pRExC_state, &nscan, minlenp, &deltanext,
|
minnext = study_chunk(pRExC_state, &nscan, minlenp, &deltanext,
|
||||||
last, &data_fake, stopparen,
|
last, &data_fake, stopparen,
|
||||||
- recursed_depth, NULL, f, depth+1);
|
- recursed_depth, NULL, f, depth+1);
|
||||||
+ recursed_depth, NULL, f, depth+1,
|
+ recursed_depth, NULL, f, depth+1,
|
||||||
+ mutate_ok);
|
+ mutate_ok);
|
||||||
if (scan->flags) {
|
if (scan->flags) {
|
||||||
if ( deltanext < 0
|
if (deltanext) {
|
||||||
|| deltanext > (I32) U8_MAX
|
FAIL("Variable length lookbehind not implemented");
|
||||||
@@ -6123,7 +6138,7 @@ Perl_re_printf( aTHX_ "LHS=%" UVuf " RHS=%" UVuf "\n",
|
@@ -5681,7 +5696,7 @@ Perl_re_printf( aTHX_ "LHS=%" UVuf " RHS=%" UVuf "\n",
|
||||||
*minnextp = study_chunk(pRExC_state, &nscan, minnextp,
|
*minnextp = study_chunk(pRExC_state, &nscan, minnextp,
|
||||||
&deltanext, last, &data_fake,
|
&deltanext, last, &data_fake,
|
||||||
stopparen, recursed_depth, NULL,
|
stopparen, recursed_depth, NULL,
|
||||||
- f,depth+1);
|
- f,depth+1);
|
||||||
+ f, depth+1, mutate_ok);
|
+ f, depth+1, mutate_ok);
|
||||||
if (scan->flags) {
|
if (scan->flags) {
|
||||||
assert(0); /* This code has never been tested since this
|
if (deltanext) {
|
||||||
is normally not compiled */
|
FAIL("Variable length lookbehind not implemented");
|
||||||
@@ -6291,7 +6306,8 @@ Perl_re_printf( aTHX_ "LHS=%" UVuf " RHS=%" UVuf "\n",
|
@@ -5841,7 +5856,8 @@ Perl_re_printf( aTHX_ "LHS=%" UVuf " RHS=%" UVuf "\n",
|
||||||
/* optimise study_chunk() for TRIE */
|
branches even though they arent otherwise used. */
|
||||||
minnext = study_chunk(pRExC_state, &scan, minlenp,
|
minnext = study_chunk(pRExC_state, &scan, minlenp,
|
||||||
&deltanext, (regnode *)nextbranch, &data_fake,
|
&deltanext, (regnode *)nextbranch, &data_fake,
|
||||||
- stopparen, recursed_depth, NULL, f,depth+1);
|
- stopparen, recursed_depth, NULL, f,depth+1);
|
||||||
|
@ -239,7 +212,7 @@ index b101752..b9ea2a0 100644
|
||||||
}
|
}
|
||||||
if (nextbranch && PL_regkind[OP(nextbranch)]==BRANCH)
|
if (nextbranch && PL_regkind[OP(nextbranch)]==BRANCH)
|
||||||
nextbranch= regnext((regnode*)nextbranch);
|
nextbranch= regnext((regnode*)nextbranch);
|
||||||
@@ -8084,7 +8100,7 @@ Perl_re_op_compile(pTHX_ SV ** const patternp, int pat_count,
|
@@ -7524,7 +7540,7 @@ Perl_re_op_compile(pTHX_ SV ** const patternp, int pat_count,
|
||||||
&data, -1, 0, NULL,
|
&data, -1, 0, NULL,
|
||||||
SCF_DO_SUBSTR | SCF_WHILEM_VISITED_POS | stclass_flag
|
SCF_DO_SUBSTR | SCF_WHILEM_VISITED_POS | stclass_flag
|
||||||
| (restudied ? SCF_TRIE_DOING_RESTUDY : 0),
|
| (restudied ? SCF_TRIE_DOING_RESTUDY : 0),
|
||||||
|
@ -248,7 +221,7 @@ index b101752..b9ea2a0 100644
|
||||||
|
|
||||||
|
|
||||||
CHECK_RESTUDY_GOTO_butfirst(LEAVE_with_name("study_chunk"));
|
CHECK_RESTUDY_GOTO_butfirst(LEAVE_with_name("study_chunk"));
|
||||||
@@ -8213,7 +8229,7 @@ Perl_re_op_compile(pTHX_ SV ** const patternp, int pat_count,
|
@@ -7670,7 +7686,7 @@ Perl_re_op_compile(pTHX_ SV ** const patternp, int pat_count,
|
||||||
SCF_DO_STCLASS_AND|SCF_WHILEM_VISITED_POS|(restudied
|
SCF_DO_STCLASS_AND|SCF_WHILEM_VISITED_POS|(restudied
|
||||||
? SCF_TRIE_DOING_RESTUDY
|
? SCF_TRIE_DOING_RESTUDY
|
||||||
: 0),
|
: 0),
|
||||||
|
@ -258,20 +231,20 @@ index b101752..b9ea2a0 100644
|
||||||
CHECK_RESTUDY_GOTO_butfirst(NOOP);
|
CHECK_RESTUDY_GOTO_butfirst(NOOP);
|
||||||
|
|
||||||
diff --git a/t/re/pat.t b/t/re/pat.t
|
diff --git a/t/re/pat.t b/t/re/pat.t
|
||||||
index 6a868f4..ba89a58 100644
|
index 1d98fe77d7..1488259b02 100644
|
||||||
--- a/t/re/pat.t
|
--- a/t/re/pat.t
|
||||||
+++ b/t/re/pat.t
|
+++ b/t/re/pat.t
|
||||||
@@ -25,7 +25,7 @@ BEGIN {
|
@@ -23,7 +23,7 @@ BEGIN {
|
||||||
skip_all('no re module') unless defined &DynaLoader::boot_DynaLoader;
|
skip_all('no re module') unless defined &DynaLoader::boot_DynaLoader;
|
||||||
skip_all_without_unicode_tables();
|
skip_all_without_unicode_tables();
|
||||||
|
|
||||||
-plan tests => 864; # Update this when adding/deleting tests.
|
-plan tests => 840; # Update this when adding/deleting tests.
|
||||||
+plan tests => 868; # Update this when adding/deleting tests.
|
+plan tests => 844; # Update this when adding/deleting tests.
|
||||||
|
|
||||||
run_tests() unless caller;
|
run_tests() unless caller;
|
||||||
|
|
||||||
@@ -2115,6 +2115,30 @@ x{0c!}\;\;îçÿ |