5.26.1 bump

This commit is contained in:
Jitka Plesnikova 2017-09-25 13:01:39 +02:00
parent 5fbdf1697c
commit b9ca5b6ecc
16 changed files with 31 additions and 816 deletions

1
.gitignore vendored
View File

@ -24,3 +24,4 @@ perl-5.12.1.tar.gz
/perl-5.24.0.tar.bz2
/perl-5.24.1.tar.bz2
/perl-5.26.0.tar.bz2
/perl-5.26.1.tar.bz2

View File

@ -1,116 +0,0 @@
From 10e784017784a8c1b1835b04026f8948eb502e50 Mon Sep 17 00:00:00 2001
From: David Mitchell <davem@iabyn.com>
Date: Fri, 16 Jun 2017 15:46:19 +0100
Subject: [PATCH] don't call Perl_fbm_instr() with negative length
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Ported to 5.26.0:
commit bb152a4b442f7718fd37d32cc558be675e8ae1ae
Author: David Mitchell <davem@iabyn.com>
Date: Fri Jun 16 15:46:19 2017 +0100
don't call Perl_fbm_instr() with negative length
RT #131575
re_intuit_start() could calculate a maximum end position less than the
current start position. This used to get rejected by fbm_intr(), until
v5.23.3-110-g147f21b, which made fbm_intr() faster and removed unnecessary
checks.
This commits fixes re_intuit_start(), and adds an assert to fbm_intr().
Signed-off-by: Petr Písař <ppisar@redhat.com>
---
regexec.c | 17 +++++++++++------
t/re/pat.t | 13 ++++++++++++-
util.c | 2 ++
3 files changed, 25 insertions(+), 7 deletions(-)
diff --git a/regexec.c b/regexec.c
index 35b88d7..4e82bc2 100644
--- a/regexec.c
+++ b/regexec.c
@@ -126,13 +126,16 @@ static const char* const non_utf8_target_but_utf8_required
(U8*)(off >= 0 ? reginfo->strend : reginfo->strbeg)) \
: (U8*)(pos + off))
-#define HOPBACKc(pos, off) \
- (char*)(reginfo->is_utf8_target \
- ? reghopmaybe3((U8*)pos, (SSize_t)0-off, (U8*)(reginfo->strbeg)) \
- : (pos - off >= reginfo->strbeg) \
- ? (U8*)pos - off \
+/* like HOPMAYBE3 but backwards. lim must be +ve. Returns NULL on overshoot */
+#define HOPBACK3(pos, off, lim) \
+ (reginfo->is_utf8_target \
+ ? reghopmaybe3((U8*)pos, (SSize_t)0-off, (U8*)(lim)) \
+ : (pos - off >= lim) \
+ ? (U8*)pos - off \
: NULL)
+#define HOPBACKc(pos, off) ((char*)HOPBACK3(pos, off, reginfo->strbeg))
+
#define HOP3(pos,off,lim) (reginfo->is_utf8_target ? reghop3((U8*)(pos), off, (U8*)(lim)) : (U8*)(pos + off))
#define HOP3c(pos,off,lim) ((char*)HOP3(pos,off,lim))
@@ -884,7 +887,9 @@ Perl_re_intuit_start(pTHX_
(IV)prog->check_end_shift);
});
- end_point = HOP3(strend, -end_shift, strbeg);
+ end_point = HOPBACK3(strend, end_shift, rx_origin);
+ if (!end_point)
+ goto fail_finish;
start_point = HOPMAYBE3(rx_origin, start_shift, end_point);
if (!start_point)
goto fail_finish;
diff --git a/t/re/pat.t b/t/re/pat.t
index 16bfc8e..2510eab 100644
--- a/t/re/pat.t
+++ b/t/re/pat.t
@@ -23,7 +23,7 @@ BEGIN {
skip_all('no re module') unless defined &DynaLoader::boot_DynaLoader;
skip_all_without_unicode_tables();
-plan tests => 837; # Update this when adding/deleting tests.
+plan tests => 838; # Update this when adding/deleting tests.
run_tests() unless caller;
@@ -1911,6 +1911,17 @@ EOP
# [perl #129281] buffer write overflow, detected by ASAN, valgrind
fresh_perl_is('/0(?0)|^*0(?0)|^*(^*())0|/', '', {}, "don't bump whilem_c too much");
}
+
+ {
+ # RT #131575 intuit skipping back from the end to find the highest
+ # possible start point, was potentially hopping back beyond pos()
+ # and crashing by calling fbm_instr with a negative length
+
+ my $text = "=t=\x{5000}";
+ pos($text) = 3;
+ ok(scalar($text !~ m{(~*=[a-z]=)}g), "RT #131575");
+ }
+
} # End of sub run_tests
1;
diff --git a/util.c b/util.c
index f1b92a9..69763bc 100644
--- a/util.c
+++ b/util.c
@@ -816,6 +816,8 @@ Perl_fbm_instr(pTHX_ unsigned char *big, unsigned char *bigend, SV *littlestr, U
PERL_ARGS_ASSERT_FBM_INSTR;
+ assert(bigend >= big);
+
if ((STRLEN)(bigend - big) < littlelen) {
if ( tail
&& ((STRLEN)(bigend - big) == littlelen - 1)
--
2.9.4

View File

@ -1,33 +0,0 @@
From 2c2da8e7f0f6325fab643997a536072633fa0cf8 Mon Sep 17 00:00:00 2001
From: Yves Orton <demerphq@gmail.com>
Date: Thu, 1 Jun 2017 14:51:44 +0200
Subject: [PATCH] Fix #131190 - UTF8 code improperly casting negative integer
to U8 in comparison
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
This reverts commit b4972372a75776de3c9e6bd234a398d103677316,
effectively restoring commit ca7eb79a236b41b7722c6800527f95cd76843eed,
and commit 85fde2b7c3f5631fd982f5db735b84dc9224bec0.
Signed-off-by: Petr Písař <ppisar@redhat.com>
---
regexec.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/regexec.c b/regexec.c
index 82128a7..35b88d7 100644
--- a/regexec.c
+++ b/regexec.c
@@ -5593,6 +5593,7 @@ S_regmatch(pTHX_ regmatch_info *reginfo, char *startpos, regnode *prog)
if (scan->flags == EXACTL || scan->flags == EXACTFLU8) {
_CHECK_AND_WARN_PROBLEMATIC_LOCALE;
if (utf8_target
+ && nextchr >= 0 /* guard against negative EOS value in nextchr */
&& UTF8_IS_ABOVE_LATIN1(nextchr)
&& scan->flags == EXACTL)
{
--
2.9.4

View File

@ -1,135 +0,0 @@
From bab0f8e933b383b6bef406d79c2da340bbcded33 Mon Sep 17 00:00:00 2001
From: Yves Orton <demerphq@gmail.com>
Date: Sun, 18 Jun 2017 20:45:30 +0200
Subject: [PATCH 1/2] Resolve Perl #131522: Spurious "Assuming NOT a POSIX
class" warning
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Petr Písař <ppisar@redhat.com>
---
regcomp.c | 30 ++++++++++++++++++------------
1 file changed, 18 insertions(+), 12 deletions(-)
diff --git a/regcomp.c b/regcomp.c
index 8921eed..0a4ea78 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -13991,6 +13991,13 @@ S_populate_ANYOF_from_invlist(pTHX_ regnode *node, SV** invlist_ptr)
REPORT_LOCATION_ARGS(p))); \
} \
} STMT_END
+#define CLEAR_POSIX_WARNINGS() \
+ if (posix_warnings && RExC_warn_text) \
+ av_clear(RExC_warn_text)
+
+#define CLEAR_POSIX_WARNINGS_AND_RETURN(ret) \
+ CLEAR_POSIX_WARNINGS(); \
+ return ret
STATIC int
S_handle_possible_posix(pTHX_ RExC_state_t *pRExC_state,
@@ -14063,7 +14070,7 @@ S_handle_possible_posix(pTHX_ RExC_state_t *pRExC_state,
*
* The syntax for a legal posix class is:
*
- * qr/(?xa: \[ : \^? [:lower:]{4,6} : \] )/
+ * qr/(?xa: \[ : \^? [[:lower:]]{4,6} : \] )/
*
* What this routine considers syntactically to be an intended posix class
* is this (the comments indicate some restrictions that the pattern
@@ -14088,7 +14095,7 @@ S_handle_possible_posix(pTHX_ RExC_state_t *pRExC_state,
* # for it to be considered to be
* # an intended posix class.
* \h*
- * [:punct:]? # The closing class character,
+ * [[:punct:]]? # The closing class character,
* # possibly omitted. If not a colon
* # nor semi colon, the class name
* # must be even closer to a valid
@@ -14131,8 +14138,7 @@ S_handle_possible_posix(pTHX_ RExC_state_t *pRExC_state,
PERL_ARGS_ASSERT_HANDLE_POSSIBLE_POSIX;
- if (posix_warnings && RExC_warn_text)
- av_clear(RExC_warn_text);
+ CLEAR_POSIX_WARNINGS();
if (p >= e) {
return NOT_MEANT_TO_BE_A_POSIX_CLASS;
@@ -14224,7 +14230,7 @@ S_handle_possible_posix(pTHX_ RExC_state_t *pRExC_state,
*updated_parse_ptr = (char *) temp_ptr;
}
- return OOB_NAMEDCLASS;
+ CLEAR_POSIX_WARNINGS_AND_RETURN(OOB_NAMEDCLASS);
}
}
@@ -14294,7 +14300,7 @@ S_handle_possible_posix(pTHX_ RExC_state_t *pRExC_state,
/* We consider something like [^:^alnum:]] to not have been intended to
* be a posix class, but XXX maybe we should */
if (complement) {
- return NOT_MEANT_TO_BE_A_POSIX_CLASS;
+ CLEAR_POSIX_WARNINGS_AND_RETURN(NOT_MEANT_TO_BE_A_POSIX_CLASS);
}
complement = 1;
@@ -14321,7 +14327,7 @@ S_handle_possible_posix(pTHX_ RExC_state_t *pRExC_state,
* this leaves this construct looking like [:] or [:^], which almost
* certainly weren't intended to be posix classes */
if (has_opening_bracket) {
- return NOT_MEANT_TO_BE_A_POSIX_CLASS;
+ CLEAR_POSIX_WARNINGS_AND_RETURN(NOT_MEANT_TO_BE_A_POSIX_CLASS);
}
/* But this function can be called when we parse the colon for
@@ -14338,7 +14344,7 @@ S_handle_possible_posix(pTHX_ RExC_state_t *pRExC_state,
/* XXX We are currently very restrictive here, so this code doesn't
* consider the possibility that, say, /[alpha.]]/ was intended to
* be a posix class. */
- return NOT_MEANT_TO_BE_A_POSIX_CLASS;
+ CLEAR_POSIX_WARNINGS_AND_RETURN(NOT_MEANT_TO_BE_A_POSIX_CLASS);
}
/* Here we have something like 'foo:]'. There was no initial colon,
@@ -14508,7 +14514,7 @@ S_handle_possible_posix(pTHX_ RExC_state_t *pRExC_state,
}
/* Otherwise, it can't have meant to have been a class */
- return NOT_MEANT_TO_BE_A_POSIX_CLASS;
+ CLEAR_POSIX_WARNINGS_AND_RETURN(NOT_MEANT_TO_BE_A_POSIX_CLASS);
}
/* If we ran off the end, and the final character was a punctuation
@@ -14558,7 +14564,7 @@ S_handle_possible_posix(pTHX_ RExC_state_t *pRExC_state,
* class name. (We can do this on the first pass, as any second pass
* will yield an even shorter name) */
if (name_len < 3) {
- return NOT_MEANT_TO_BE_A_POSIX_CLASS;
+ CLEAR_POSIX_WARNINGS_AND_RETURN(NOT_MEANT_TO_BE_A_POSIX_CLASS);
}
/* Find which class it is. Initially switch on the length of the name.
@@ -14717,7 +14723,7 @@ S_handle_possible_posix(pTHX_ RExC_state_t *pRExC_state,
}
/* Here neither pass found a close-enough class name */
- return NOT_MEANT_TO_BE_A_POSIX_CLASS;
+ CLEAR_POSIX_WARNINGS_AND_RETURN(NOT_MEANT_TO_BE_A_POSIX_CLASS);
}
probably_meant_to_be:
@@ -14759,7 +14765,7 @@ S_handle_possible_posix(pTHX_ RExC_state_t *pRExC_state,
/* If it is a known class, return the class. The class number
* #defines are structured so each complement is +1 to the normal
* one */
- return class_number + complement;
+ CLEAR_POSIX_WARNINGS_AND_RETURN(class_number + complement);
}
else if (! check_only) {
--
2.9.4

View File

@ -1,39 +0,0 @@
From d730a80128abafff1e47e2506c23a8c1a06cfef4 Mon Sep 17 00:00:00 2001
From: Yves Orton <demerphq@gmail.com>
Date: Sun, 18 Jun 2017 23:44:07 +0200
Subject: [PATCH 2/2] add test for [perl #131522] and fix test for (related)
[perl #127581]
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Petr Písař <ppisar@redhat.com>
---
t/re/reg_mesg.t | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/t/re/reg_mesg.t b/t/re/reg_mesg.t
index 090eccb..a0b78c4 100644
--- a/t/re/reg_mesg.t
+++ b/t/re/reg_mesg.t
@@ -221,7 +221,6 @@ my @death =
'/(?[[[::]]])/' => "Syntax error in (?[...]) in regex m/(?[[[::]]])/",
'/(?[[[:w:]]])/' => "Syntax error in (?[...]) in regex m/(?[[[:w:]]])/",
'/(?[[:w:]])/' => "",
- '/[][[:alpha:]]' => "", # [perl #127581]
'/([.].*)[.]/' => "", # [perl #127582]
'/[.].*[.]/' => "", # [perl #127604]
'/(?[a])/' => 'Unexpected character {#} m/(?[a{#}])/',
@@ -587,7 +586,8 @@ my @warning = (
'Assuming NOT a POSIX class since a semi-colon was found instead of a colon {#} m/[foo;{#}punct;]]\x{100}/',
'Assuming NOT a POSIX class since a semi-colon was found instead of a colon {#} m/[foo;punct;]{#}]\x{100}/',
],
-
+ '/[][[:alpha:]]/' => "", # [perl #127581]
+ '/[][[:alpha:]\\@\\\\^_?]/' => "", # [perl #131522]
); # See comments before this for why '\x{100}' is generally needed
# These need the character 'ネ' as a marker for mark_as_utf8()
--
2.9.4

View File

@ -1,53 +0,0 @@
From 790acddeaa0d2c73524596048b129561225cf100 Mon Sep 17 00:00:00 2001
From: Father Chrysostomos <sprout@cpan.org>
Date: Fri, 7 Apr 2017 14:08:02 -0700
Subject: [PATCH] [perl #131085] Crash with sub-in-stash
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
$ perl -e '$::{"A"} = sub {}; \&{"A"}'
Segmentation fault (core dumped)
The code that vivifies a typeglob out of a code ref assumed that the
CV had a name hek, which is always the case when perl itself puts the
code ref there (via sub A{}), but is not necessarily the case if
someone is insinuating other stuff into the stash.
Signed-off-by: Petr Písař <ppisar@redhat.com>
---
gv.c | 2 +-
t/op/gv.t | 4 ++++
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/gv.c b/gv.c
index d32a9c5..315ec49 100644
--- a/gv.c
+++ b/gv.c
@@ -421,7 +421,7 @@ Perl_gv_init_pvn(pTHX_ GV *gv, HV *stash, const char *name, STRLEN len, U32 flag
/* Not actually a constant. Just a regular sub. */
CV * const cv = (CV *)has_constant;
GvCV_set(gv,cv);
- if (CvSTASH(cv) == stash && (
+ if (CvNAMED(cv) && CvSTASH(cv) == stash && (
CvNAME_HEK(cv) == GvNAME_HEK(gv)
|| ( HEK_LEN(CvNAME_HEK(cv)) == HEK_LEN(GvNAME_HEK(gv))
&& HEK_FLAGS(CvNAME_HEK(cv)) != HEK_FLAGS(GvNAME_HEK(gv))
diff --git a/t/op/gv.t b/t/op/gv.t
index 8d5e7dc..4fe6b00 100644
--- a/t/op/gv.t
+++ b/t/op/gv.t
@@ -1187,6 +1187,10 @@ package GV_DOWNGRADE {
::like "$GV_DOWNGRADE::{FOO}", qr/SCALAR/, "gv_downgrade: post";
}
+# [perl #131085] This used to crash; no ok() necessary.
+$::{"A131085"} = sub {}; \&{"A131085"};
+
+
__END__
Perl
Rules
--
2.9.4

View File

@ -1,37 +0,0 @@
From 9604fbf0722bd97ca6031a263c50ad52b6633db7 Mon Sep 17 00:00:00 2001
From: Tony Cook <tony@develop-help.com>
Date: Wed, 14 Jun 2017 09:42:31 +1000
Subject: [PATCH] (perl #131526) don't go beyond the end of the NUL in my_atof2
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Perl_my_atof2() calls GROK_NUMERIC_RADIX() to detect and skip past
a decimal point and then can increment the parse pointer (s) before
checking what it points at, so skipping the terminating NUL if the
decimal point is immediately before the NUL.
Signed-off-by: Petr Písař <ppisar@redhat.com>
---
numeric.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/numeric.c b/numeric.c
index 6ea6968..5771907 100644
--- a/numeric.c
+++ b/numeric.c
@@ -1485,9 +1485,9 @@ Perl_my_atof2(pTHX_ const char* orig, NV* value)
else if (!seen_dp && GROK_NUMERIC_RADIX(&s, send)) {
seen_dp = 1;
if (sig_digits > MAX_SIG_DIGITS) {
- do {
+ while (isDIGIT(*s)) {
++s;
- } while (isDIGIT(*s));
+ }
break;
}
}
--
2.9.4

View File

@ -1,63 +0,0 @@
From 1d5030e143202c1e963e1fc91eb6f3afaa2df83e Mon Sep 17 00:00:00 2001
From: Karl Williamson <khw@cpan.org>
Date: Sat, 24 Jun 2017 11:47:19 -0600
Subject: [PATCH] PATCH: [perl #131646] Assertion fail UTF-8 error msg
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Instead of croaking with a proper message, creating the message creates
an assertion failure.
The cause was that there were two ++ operators on a string, so one
should subtract 2 to get to the string start, but only 1 was being
subtracted.
This is a 5.26 regression, but not terribly consequential, as the
program is about to die, but it is a trivial fix that allows the reason
the crash is happening to be properly displayed to aid debugging, so I'm
adding my vote for it for 5.26.1.
Signed-off-by: Petr Písař <ppisar@redhat.com>
---
t/lib/warnings/utf8 | 13 +++++++++++++
utf8.c | 2 +-
2 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/t/lib/warnings/utf8 b/t/lib/warnings/utf8
index a4dfb12..a26bbed 100644
--- a/t/lib/warnings/utf8
+++ b/t/lib/warnings/utf8
@@ -749,3 +749,16 @@ BEGIN{
{};$^H=eval'2**400'}Â
EXPECT
Malformed UTF-8 character: \xc2\x0a (unexpected non-continuation byte 0x0a, immediately after start byte 0xc2; need 2 bytes, got 1) at - line 11.
+########
+# NAME [perl #131646]
+BEGIN{
+ if (ord('A') == 193) {
+ print "SKIPPED\n# ebcdic platforms generates different Malformed UTF-8 warnings.";
+ exit 0;
+ }
+}
+no warnings;
+use warnings 'utf8';
+for(uc 0..t){0~~pack"UXp>",exp}
+EXPECT
+Malformed UTF-8 character: \xc2\x00 (unexpected non-continuation byte 0x00, immediately after start byte 0xc2; need 2 bytes, got 1) in smart match at - line 9.
diff --git a/utf8.c b/utf8.c
index 68ac640..2ee701a 100644
--- a/utf8.c
+++ b/utf8.c
@@ -1875,7 +1875,7 @@ Perl_bytes_cmp_utf8(pTHX_ const U8 *b, STRLEN blen, const U8 *u, STRLEN ulen)
/* diag_listed_as: Malformed UTF-8 character%s */
Perl_ck_warner_d(aTHX_ packWARN(WARN_UTF8),
"%s %s%s",
- unexpected_non_continuation_text(u - 1, 2, 1, 2),
+ unexpected_non_continuation_text(u - 2, 2, 1, 2),
PL_op ? " in " : "",
PL_op ? OP_DESC(PL_op) : "");
return -2;
--
2.9.4

View File

@ -42,26 +42,26 @@ index ed13273..93e020b 100644
=head2 The 'unicode_eval' and 'evalbytes' features
diff --git a/pod/perldelta.pod b/pod/perldelta.pod
index 06dcd1d..d31335f 100644
--- a/pod/perldelta.pod
+++ b/pod/perldelta.pod
@@ -3206,6 +3206,15 @@ calls.
Parsing bad POSIX charclasses no longer leaks memory.
L<[perl #128313]|https://rt.perl.org/Public/Bug/Display.html?id=128313>
+=item *
+
+C<split ' '> now correctly handles the argument being split when in the
+scope of the L<< C<unicode_strings>|feature/"The 'unicode_strings' feature"
+>> feature. Previously, when a string using the single-byte internal
+representation contained characters that are whitespace by Unicode rules but
+not by ASCII rules, it treated those characters as part of fields rather
+than as field separators. [perl #130907]
+
=back
=head1 Known Problems
#diff --git a/pod/perldelta.pod b/pod/perldelta.pod
#index 06dcd1d..d31335f 100644
#--- a/pod/perldelta.pod
#+++ b/pod/perldelta.pod
#@@ -3206,6 +3206,15 @@ calls.
# Parsing bad POSIX charclasses no longer leaks memory.
# L<[perl #128313]|https://rt.perl.org/Public/Bug/Display.html?id=128313>
#
#+=item *
#+
#+C<split ' '> now correctly handles the argument being split when in the
#+scope of the L<< C<unicode_strings>|feature/"The 'unicode_strings' feature"
#+>> feature. Previously, when a string using the single-byte internal
#+representation contained characters that are whitespace by Unicode rules but
#+not by ASCII rules, it treated those characters as part of fields rather
#+than as field separators. [perl #130907]
#+
# =back
#
# =head1 Known Problems
diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod
index b8dca6e..9abadf4 100644
--- a/pod/perlfunc.pod

View File

@ -1,62 +0,0 @@
From 6091bd4ca4a4a4c9b6f8cadddb53c19b96748a04 Mon Sep 17 00:00:00 2001
From: Tony Cook <tony@develop-help.com>
Date: Mon, 19 Jun 2017 14:59:53 +1000
Subject: [PATCH] (perl #131597) ensure the GV slot is filled for our [%$@]foo:
attr
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Petr Písař <ppisar@redhat.com>
---
op.c | 6 +++---
t/op/attrs.t | 18 ++++++++++++++++++
2 files changed, 21 insertions(+), 3 deletions(-)
diff --git a/op.c b/op.c
index 1a2101c..c6b5ec7 100644
--- a/op.c
+++ b/op.c
@@ -3826,9 +3826,9 @@ S_my_kid(pTHX_ OP *o, OP *attrs, OP **imopsp)
PL_parser->in_my = FALSE;
PL_parser->in_my_stash = NULL;
apply_attrs(GvSTASH(gv),
- (type == OP_RV2SV ? GvSV(gv) :
- type == OP_RV2AV ? MUTABLE_SV(GvAV(gv)) :
- type == OP_RV2HV ? MUTABLE_SV(GvHV(gv)) : MUTABLE_SV(gv)),
+ (type == OP_RV2SV ? GvSVn(gv) :
+ type == OP_RV2AV ? MUTABLE_SV(GvAVn(gv)) :
+ type == OP_RV2HV ? MUTABLE_SV(GvHVn(gv)) : MUTABLE_SV(gv)),
attrs);
}
o->op_private |= OPpOUR_INTRO;
diff --git a/t/op/attrs.t b/t/op/attrs.t
index 2514270..649525c 100644
--- a/t/op/attrs.t
+++ b/t/op/attrs.t
@@ -489,4 +489,22 @@ EOP
is($out, '', 'RT #3605: $a ? my $var : my $othervar is perfectly valid syntax');
}
+fresh_perl_is('sub dummy {} our $dummy : Dummy', <<EOS, {},
+Invalid SCALAR attribute: Dummy at - line 1.
+BEGIN failed--compilation aborted at - line 1.
+EOS
+ "attribute on our scalar with sub of same name");
+
+fresh_perl_is('sub dummy {} our @dummy : Dummy', <<EOS, {},
+Invalid ARRAY attribute: Dummy at - line 1.
+BEGIN failed--compilation aborted at - line 1.
+EOS
+ "attribute on our array with sub of same name");
+
+fresh_perl_is('sub dummy {} our %dummy : Dummy', <<EOS, {},
+Invalid HASH attribute: Dummy at - line 1.
+BEGIN failed--compilation aborted at - line 1.
+EOS
+ "attribute on our hash with sub of same name");
+
done_testing();
--
2.9.4

View File

@ -1,126 +0,0 @@
From e26c6904d9f9f5ea818e590331b14038279332d1 Mon Sep 17 00:00:00 2001
From: Father Chrysostomos <sprout@cpan.org>
Date: Sun, 25 Jun 2017 06:37:19 -0700
Subject: [PATCH] [perl #131645] Fix assert fail in pp_sselect
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
pp_sselect (4-arg select) process its first three bitfield arguments
first, making sure each one has a valid PV, and then it moves on to
the final, timeout argument.
SvGETMAGIC() on the timeout argument will wipe out any values the SV
holds, so if the same scalar is used as a bitfield argument *and* as
the timeout, it will no longer hold a valid PV.
Assertions later in pp_sselect make sure there is a valid PV.
This commit solves the assertion failure by making a temporary copy of
any gmagical or overloaded argument. When the temporary copy is made,
the values written to the temporary copies of the bitfield arguments
are then copied back to the original magical arguments.
Signed-off-by: Petr Písař <ppisar@redhat.com>
---
pp_sys.c | 21 +++++++++++++++------
t/op/sselect.t | 11 ++++++++++-
2 files changed, 25 insertions(+), 7 deletions(-)
diff --git a/pp_sys.c b/pp_sys.c
index 65900fa..100762c 100644
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -1149,6 +1149,7 @@ PP(pp_sselect)
struct timeval *tbuf = &timebuf;
I32 growsize;
char *fd_sets[4];
+ SV *svs[4];
#if BYTEORDER != 0x1234 && BYTEORDER != 0x12345678
I32 masksize;
I32 offset;
@@ -1164,7 +1165,7 @@ PP(pp_sselect)
SP -= 4;
for (i = 1; i <= 3; i++) {
- SV * const sv = SP[i];
+ SV * const sv = svs[i] = SP[i];
SvGETMAGIC(sv);
if (!SvOK(sv))
continue;
@@ -1177,9 +1178,14 @@ PP(pp_sselect)
if (!SvPOKp(sv))
Perl_ck_warner(aTHX_ packWARN(WARN_MISC),
"Non-string passed as bitmask");
- SvPV_force_nomg_nolen(sv); /* force string conversion */
+ if (SvGAMAGIC(sv)) {
+ svs[i] = sv_newmortal();
+ sv_copypv_nomg(svs[i], sv);
+ }
+ else
+ SvPV_force_nomg_nolen(sv); /* force string conversion */
}
- j = SvCUR(sv);
+ j = SvCUR(svs[i]);
if (maxlen < j)
maxlen = j;
}
@@ -1228,7 +1234,7 @@ PP(pp_sselect)
tbuf = NULL;
for (i = 1; i <= 3; i++) {
- sv = SP[i];
+ sv = svs[i];
if (!SvOK(sv) || SvCUR(sv) == 0) {
fd_sets[i] = 0;
continue;
@@ -1275,7 +1281,7 @@ PP(pp_sselect)
#endif
for (i = 1; i <= 3; i++) {
if (fd_sets[i]) {
- sv = SP[i];
+ sv = svs[i];
#if BYTEORDER != 0x1234 && BYTEORDER != 0x12345678
s = SvPVX(sv);
for (offset = 0; offset < growsize; offset += masksize) {
@@ -1284,7 +1290,10 @@ PP(pp_sselect)
}
Safefree(fd_sets[i]);
#endif
- SvSETMAGIC(sv);
+ if (sv != SP[i])
+ SvSetMagicSV(SP[i], sv);
+ else
+ SvSETMAGIC(sv);
}
}
diff --git a/t/op/sselect.t b/t/op/sselect.t
index fedbfc7..9ec1c63 100644
--- a/t/op/sselect.t
+++ b/t/op/sselect.t
@@ -13,7 +13,7 @@ BEGIN {
skip_all("Win32 miniperl has no socket select")
if $^O eq "MSWin32" && is_miniperl();
-plan (15);
+plan (16);
my $blank = "";
eval {select undef, $blank, $blank, 0};
@@ -95,3 +95,12 @@ note("diff=$diff under=$under");
select (undef, undef, undef, $sleep);
::is($count, 1, 'RT120102');
}
+
+package _131645{
+ sub TIESCALAR { bless [] }
+ sub FETCH { 0 }
+ sub STORE { }
+}
+tie $tie, _131645::;
+select ($tie, undef, undef, $tie);
+ok("no crash from select $numeric_tie, undef, undef, $numeric_tie")
--
2.9.4

View File

@ -20,7 +20,7 @@ index 9066308..dfc58c1 100644
+++ b/t/lib/warnings/utf8
@@ -781,4 +781,5 @@ no warnings;
use warnings 'utf8';
for(uc 0..t){0~~pack"UXp>",exp}
for(uc 0..t){0~~pack"UXc",exp}
EXPECT
-Malformed UTF-8 character: \xc2\x00 (unexpected non-continuation byte 0x00, immediately after start byte 0xc2; need 2 bytes, got 1) in smart match at - line 9.
+OPTIONS regex

View File

@ -1,29 +0,0 @@
From b9486474d36974b83d0b00fdcbfd1530299a0f7c Mon Sep 17 00:00:00 2001
From: Ken Brown <kbrown@cornell.edu>
Date: Thu, 27 Jul 2017 11:57:44 -0400
Subject: [PATCH] Configure: check for GCC 6 and 7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Petr Písař <ppisar@redhat.com>
---
Configure | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Configure b/Configure
index 3259249..bdcfaf1 100755
--- a/Configure
+++ b/Configure
@@ -23612,7 +23612,7 @@ fi
: add -D_FORTIFY_SOURCE if feasible and not already there
case "$gccversion" in
-[45].*) case "$optimize$ccflags" in
+[4567].*) case "$optimize$ccflags" in
*-O*) case "$ccflags$cppsymbols" in
*_FORTIFY_SOURCE=*) # Don't add it again.
echo "You seem to have -D_FORTIFY_SOURCE already, not adding it." >&4
--
2.9.4

View File

@ -1,43 +0,0 @@
From 9c6b56dc65cdd9256fbe04a7baf4f085db1c04dd Mon Sep 17 00:00:00 2001
From: Tony Cook <tony@develop-help.com>
Date: Tue, 8 Aug 2017 14:45:29 +1000
Subject: [PATCH] (perl #131646) make the test less fragile
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
The original pattern "UXp>" with the $_ that causes the failure, 5,
so we end up packing exp(5) or 148.... with U packs:
- U (148), producing C2 94, with the UTF8 flag set
- X - back up a byte,
- p> - write the address of PL_sv_no's PV in big-ending
The final p> will typically overwrite the 94 with a zero on 64-bit
systems, but with the smaller address space of 32-bit systems that
high-byte is more likely to be a valid continuation byte, causing
the comparison to fail.
Instead just pack a zero byte.
Signed-off-by: Petr Písař <ppisar@redhat.com>
---
t/lib/warnings/utf8 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/t/lib/warnings/utf8 b/t/lib/warnings/utf8
index dfc58c1..a9a6388 100644
--- a/t/lib/warnings/utf8
+++ b/t/lib/warnings/utf8
@@ -779,7 +779,7 @@ BEGIN{
}
no warnings;
use warnings 'utf8';
-for(uc 0..t){0~~pack"UXp>",exp}
+for(uc 0..t){0~~pack"UXc",exp}
EXPECT
OPTIONS regex
Malformed UTF-8 character: \\x([[:xdigit:]]{2})\\x([[:xdigit:]]{2}) \(unexpected non-continuation byte 0x\2, immediately after start byte 0x\1; need 2 bytes, got 1\) in smart match at - line 9.
--
2.9.4

View File

@ -1,4 +1,4 @@
%global perl_version 5.26.0
%global perl_version 5.26.1
%global perl_epoch 4
%global perl_arch_stem -thread-multi
%global perl_archname %{_arch}-%{_os}%{perl_arch_stem}
@ -79,7 +79,7 @@ License: GPL+ or Artistic
Epoch: %{perl_epoch}
Version: %{perl_version}
# release number must be even higher, because dual-lived modules will be broken otherwise
Release: 399%{?dist}
Release: 400%{?dist}
Summary: Practical Extraction and Report Language
Url: http://www.perl.org/
Source0: http://www.cpan.org/src/5.0/perl-%{perl_version}.tar.bz2
@ -144,14 +144,6 @@ Patch30: perl-5.22.1-Replace-EU-MM-dependnecy-with-EU-MM-Utils-in-IPC-Cmd
# in upstream after 5.27.0
Patch31: perl-5.27.0-perl-131211-fixup-File-Glob-degenerate-matching.patch
# Fix a crash when calling a subroutine from a stash, RT#131085,
# in upstream after 5.27.0
Patch32: perl-5.27.0-perl-131085-Crash-with-sub-in-stash.patch
# Fix an improper cast of a negative integer to an unsigned 8-bit type,
# RT#131190, in upstream after 5.27.0
Patch33: perl-5.27.0-Fix-131190-UTF8-code-improperly-casting-negative-int.patch
# Fix cloning :via handles on thread creation, RT#131221,
# in upstream after 5.27.0
Patch34: perl-5.27.0-perl-131221-improve-duplication-of-via-handles.patch
@ -161,26 +153,12 @@ Patch35: perl-5.27.0-perl-131221-sv_dup-sv_dup_inc-are-only-available-und
# in upstream after 5.27.0
Patch36: perl-5.26.0-perl-131263-clear-the-UTF8-flag-on-a-glob-if-it-isn-.patch
# Fix a buffer overflow in my_atof2(), RT#131526, in upstream after 5.27.0
Patch37: perl-5.27.0-perl-131526-don-t-go-beyond-the-end-of-the-NUL-in-my.patch
# Fix handling backslashes in PATH environment variable when executing
# "perl -S", RT#129183, in upstream after 5.27.0
Patch38: perl-5.27.0-perl-129183-don-t-treat-as-an-escape-in-PATH-for-S.patch
# Fix a conditional jump on uninitilized memory in re_intuit_start(),
# RT#131575, in upstream after 5.27.0
Patch39: perl-5.26.0-don-t-call-Perl_fbm_instr-with-negative-length.patch
# Fix spurious "Assuming NOT a POSIX class" warning, RT#131522,
# in upsteam after 5.27.0
Patch40: perl-5.27.0-Resolve-Perl-131522-Spurious-Assuming-NOT-a-POSIX-cl.patch
Patch41: perl-5.27.0-add-test-for-perl-131522-and-fix-test-for-related-pe.patch
# Fix reporting malformed UTF-8 character, RT#131646, in upstream after 5.27.1
Patch42: perl-5.27.1-PATCH-perl-131646-Assertion-fail-UTF-8-error-msg.patch
Patch43: perl-5.27.1-t-lib-warnings-utf8-Fix-test.patch
Patch44: perl-5.27.2-perl-131646-make-the-test-less-fragile.patch
# Fix File::Glob rt131211.t test random failures, in upstream after 5.27.1
Patch45: perl-5.27.1-File-Glob-tweak-rt131211.t-to-be-less-sensitive-on-w.patch
@ -197,10 +175,6 @@ Patch48: perl-5.27.1-add-an-additional-test-for-whitespace-tolerance-in-c
# in upstream after 5.27.1
Patch49: perl-5.27.1-utf8n_to_uvchr-Don-t-display-too-many-bytes-in-msg.patch
# Fix select called with a repeated magical variable, RT#131645,
# in upstream after 5.27.1
Patch50: perl-5.27.1-perl-131645-Fix-assert-fail-in-pp_sselect.patch
# Fix error message for "our sub foo::bar", RT#131679, in upstream after 5.27.1
Patch51: perl-5.27.1-perl-131679-Fix-our-sub-foo-bar-message.patch
@ -208,10 +182,6 @@ Patch51: perl-5.27.1-perl-131679-Fix-our-sub-foo-bar-message.patch
# not yet accepted by upstream
Patch52: perl-5.26.0-perl-131588-be-a-little-more-careful-in-arybase-_tie.patch
# Fix handling attribute specification on our variables, RT#131597,
# in upstream adter 5.27.1
Patch53: perl-5.27.1-perl-131597-ensure-the-GV-slot-is-filled-for-our-foo.patch
# Fix splitting non-ASCII strings if unicode_strings feature is enabled,
# RT#130907 in upstream after 5.27.1
Patch54: perl-5.27.1-RT-130907-Fix-the-Unicode-Bug-in-split.patch
@ -224,10 +194,6 @@ Patch55: perl-5.27.2-Avoid-compiler-warnings-due-to-mismatched-types-in-p
# in upstream after 5.27.2
Patch56: perl-5.27.2-EU-Constant-avoid-uninit-warning.patch
# Fix GCC version detection for -D_FORTIFY_SOURCE override, RT#131809,
# in upstream after 5.27.2
Patch57: perl-5.27.2-Configure-check-for-GCC-6-and-7.patch
# Fix unreliable Time-HiRes tests, CPAN RT#122819, in Time-HiRes-1.9746
Patch58: perl-5.26.0-Time-HiRes-Fix-unreliable-t-usleep.t-and-t-utime.t.patch
@ -1906,7 +1872,7 @@ encoder/decoder. These encoding methods are specified in RFC 2045 - MIME
Summary: What modules are shipped with versions of perl
License: GPL+ or Artistic
Epoch: 1
Version: 5.20170530
Version: 5.20170922
Requires: %perl_compat
Requires: perl(List::Util)
Requires: perl(version) >= 0.88
@ -1924,7 +1890,7 @@ are shipped with each version of perl.
Summary: Tool for listing modules shipped with perl
License: GPL+ or Artistic
Epoch: 1
Version: 5.20170530
Version: 5.20170922
Requires: %perl_compat
Requires: perl(feature)
Requires: perl(version) >= 0.88
@ -2786,32 +2752,21 @@ Perl extension for Version Objects
%patch26 -p1
%patch30 -p1
%patch31 -p1
%patch32 -p1
%patch33 -p1
%patch34 -p1
%patch35 -p1
%patch36 -p1
%patch37 -p1
%patch38 -p1
%patch39 -p1
%patch40 -p1
%patch41 -p1
%patch42 -p1
%patch43 -p1
%patch44 -p1
%patch45 -p1
%patch46 -p1
%patch47 -p1
%patch48 -p1
%patch49 -p1
%patch50 -p1
%patch51 -p1
%patch52 -p1
%patch53 -p1
%patch54 -p1
%patch55 -p1
%patch56 -p1
%patch57 -p1
%patch58 -p1
%patch200 -p1
%patch201 -p1
@ -2834,27 +2789,18 @@ perl -x patchlevel.h \
'Fedora Patch27: Make PadlistNAMES() lvalue again (CPAN RT#101063)' \
'Fedora Patch30: Replace EU::MakeMaker dependency with EU::MM::Utils in IPC::Cmd (bug #1129443)' \
'Fedora Patch31: Make File::Glob more resistant against degenerative matching (RT#131211)' \
'Fedora Patch32: Fix a crash when calling a subroutine from a stash (RT#131085)' \
'Fedora Patch33: Fix an improper cast of a negative integer to an unsigned 8-bit type (RT#131190)' \
'Fedora Patch34: Fix cloning :via handles on thread creation (RT#131221)' \
'Fedora Patch36: Fix glob UTF-8 flag on a glob reassignment (RT#131263)' \
'Fedora Patch37: Fix a buffer overflow in my_atof2() (RT#131526)' \
'Fedora Patch38: Fix handling backslashes in PATH environment variable when executing "perl -S" (RT#129183)' \
'Fedora Patch39: Fix a conditional jump on uninitilized memory in re_intuit_start() (RT#131575)' \
'Fedora Patch40: Fix spurious "Assuming NOT a POSIX class" warning (RT#131522)' \
'Fedora Patch42: Fix reporting malformed UTF-8 character (RT#131646)' \
'Fedora Patch45: Fix File::Glob rt131211.t test random failures' \
'Fedora Patch46: Fix t/op/hash.t test random failures' \
'Fedora Patch47: Parse caret variables with subscripts as normal variables inside ${...} escaping (RT#131664)' \
'Fedora Patch49: Do not display too many bytes when reporting malformed UTF-8 character' \
'Fedora Patch50: Fix select called with a repeated magical variable (RT#131645)' \
'Fedora Patch51: Fix error message for "our sub foo::bar" (RT#131679)' \
'Fedora Patch52: Fix executing arybase::_tie_it() in Safe compartement (RT#131588)' \
'Fedora Patch53: Fix handling attribute specification on our variables (RT#131597)' \
'Fedora Patch54: Fix splitting non-ASCII strings if unicode_strings feature is enabled (RT#130907)' \
'Fedora Patch55: Fix compiler warnings in code generated by ExtUtils::Constant (CPAN RT#63832)' \
'Fedora Patch56: Fix compiler warnings in code generated by ExtUtils::Constant (CPAN RT#101487)' \
'Fedora Patch57: Fix GCC version detection for -D_FORTIFY_SOURCE override (RT#131809)' \
'Fedora Patch58: Fix unreliable Time-HiRes tests (CPAN RT#122819)' \
'Fedora Patch200: Link XS modules to libperl.so with EU::CBuilder on Linux' \
'Fedora Patch201: Link XS modules to libperl.so with EU::MM on Linux' \
@ -5139,6 +5085,10 @@ popd
# Old changelog entries are preserved in CVS.
%changelog
* Mon Sep 25 2017 Jitka Plesnikova <jplesnik@redhat.com> - 4:5.26.1-400
- 5.26.1 bump (see <http://search.cpan.org/dist/perl-5.26.1/pod/perldelta.pod>
for release notes)
* Tue Aug 22 2017 Petr Pisar <ppisar@redhat.com> - 4:5.26.0-399
- Fix unreliable Time-HiRes tests (CPAN RT#122819)
- Do not require $Config{libs} providers by perl-devel package (bug #1481324)

View File

@ -1 +1 @@
SHA512 (perl-5.26.0.tar.bz2) = 1e3849c0fbf3a1903f83f86470d44f55f0f22136a1bdeb829af9c47351b6c817d7d8961a2db4c9172285f5abc087ea105ccfd4c93025acbd73569e628669aab3
SHA512 (perl-5.26.1.tar.bz2) = 821a4b78a22d24d6f79b56f68ed4a36db24bddc4dbe36c9d2622cd15d7abf6548186c037dea3d3745c1781af83339d0b54297f8094aa538046c0e57a953b5547