|
|
276c98 |
From 60a26c797bbff039ea7f861903732e7cceae415a Mon Sep 17 00:00:00 2001
|
|
|
276c98 |
From: Hugo van der Sanden <hv@crypt.org>
|
|
|
276c98 |
Date: Sun, 15 May 2016 13:48:58 -0700
|
|
|
276c98 |
Subject: [PATCH 1/2] [perl #128086] Fix precedence in hv_ename_delete
|
|
|
276c98 |
MIME-Version: 1.0
|
|
|
276c98 |
Content-Type: text/plain; charset=UTF-8
|
|
|
276c98 |
Content-Transfer-Encoding: 8bit
|
|
|
276c98 |
|
|
|
276c98 |
A stash’s array of names may have null for the first entry, in which
|
|
|
276c98 |
case it is not one of the effective names, and the name count will
|
|
|
276c98 |
be negative.
|
|
|
276c98 |
|
|
|
276c98 |
The ‘count > 0’ is meant to prevent hv_ename_delete from trying to
|
|
|
276c98 |
read that entry, but a precedence problem introduced in 4643eb699
|
|
|
276c98 |
stopped it from doing that.
|
|
|
276c98 |
|
|
|
276c98 |
[This commit message was written by the committer.]
|
|
|
276c98 |
|
|
|
276c98 |
Signed-off-by: Petr Písař <ppisar@redhat.com>
|
|
|
276c98 |
---
|
|
|
276c98 |
hv.c | 3 ++-
|
|
|
276c98 |
1 file changed, 2 insertions(+), 1 deletion(-)
|
|
|
276c98 |
|
|
|
276c98 |
diff --git a/hv.c b/hv.c
|
|
|
276c98 |
index 7b5ad95..5523475 100644
|
|
|
276c98 |
--- a/hv.c
|
|
|
276c98 |
+++ b/hv.c
|
|
|
276c98 |
@@ -2476,9 +2476,10 @@ Perl_hv_ename_delete(pTHX_ HV *hv, const char *name, U32 len, U32 flags)
|
|
|
276c98 |
return;
|
|
|
276c98 |
}
|
|
|
276c98 |
if (
|
|
|
276c98 |
- count > 0 && (HEK_UTF8(*namep) || (flags & SVf_UTF8))
|
|
|
276c98 |
+ count > 0 && ((HEK_UTF8(*namep) || (flags & SVf_UTF8))
|
|
|
276c98 |
? hek_eq_pvn_flags(aTHX_ *namep, name, (I32)len, flags)
|
|
|
276c98 |
: (HEK_LEN(*namep) == (I32)len && memEQ(HEK_KEY(*namep), name, len))
|
|
|
276c98 |
+ )
|
|
|
276c98 |
) {
|
|
|
276c98 |
aux->xhv_name_count = -count;
|
|
|
276c98 |
}
|
|
|
276c98 |
--
|
|
|
276c98 |
2.5.5
|
|
|
276c98 |
|
|
|
276c98 |
From 7f1bd063e5aa5aeb26ed9c39db6864cc0ecd7a73 Mon Sep 17 00:00:00 2001
|
|
|
276c98 |
From: Father Chrysostomos <sprout@cpan.org>
|
|
|
276c98 |
Date: Sun, 15 May 2016 13:49:33 -0700
|
|
|
276c98 |
Subject: [PATCH 2/2] [perl #128086] Test the prev commit
|
|
|
276c98 |
MIME-Version: 1.0
|
|
|
276c98 |
Content-Type: text/plain; charset=UTF-8
|
|
|
276c98 |
Content-Transfer-Encoding: 8bit
|
|
|
276c98 |
|
|
|
276c98 |
Signed-off-by: Petr Písař <ppisar@redhat.com>
|
|
|
276c98 |
---
|
|
|
276c98 |
t/op/stash.t | 9 ++++++++-
|
|
|
276c98 |
1 file changed, 8 insertions(+), 1 deletion(-)
|
|
|
276c98 |
|
|
|
276c98 |
diff --git a/t/op/stash.t b/t/op/stash.t
|
|
|
276c98 |
index 151b729..b8e0f34 100644
|
|
|
276c98 |
--- a/t/op/stash.t
|
|
|
276c98 |
+++ b/t/op/stash.t
|
|
|
276c98 |
@@ -7,7 +7,7 @@ BEGIN {
|
|
|
276c98 |
|
|
|
276c98 |
BEGIN { require "./test.pl"; }
|
|
|
276c98 |
|
|
|
276c98 |
-plan( tests => 51 );
|
|
|
276c98 |
+plan( tests => 52 );
|
|
|
276c98 |
|
|
|
276c98 |
# Used to segfault (bug #15479)
|
|
|
276c98 |
fresh_perl_like(
|
|
|
276c98 |
@@ -334,3 +334,10 @@ is runperl(
|
|
|
276c98 |
),
|
|
|
276c98 |
"ok\n",
|
|
|
276c98 |
'[perl #123847] no crash from *foo::=*bar::=*glob_with_hash';
|
|
|
276c98 |
+
|
|
|
276c98 |
+is runperl(
|
|
|
276c98 |
+ prog => '%h; *::::::=*h; delete $::{q|::|}; print qq|ok\n|',
|
|
|
276c98 |
+ stderr => 1,
|
|
|
276c98 |
+ ),
|
|
|
276c98 |
+ "ok\n",
|
|
|
276c98 |
+ '[perl #128086] no crash from assigning hash to *:::::: & deleting it';
|
|
|
276c98 |
--
|
|
|
276c98 |
2.5.5
|
|
|
276c98 |
|