summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2010-11-22 16:42:00 -0800
committerFather Chrysostomos <sprout@cpan.org>2010-11-22 16:43:32 -0800
commit605aedcce76632b4ab6d032b928335097c11784a (patch)
tree0a6f0fac2bf2083b91da89595f7d7bcf7fa2e0f7
parent0a4df5147978fdeecf143dcc58bc4e04e196aced (diff)
downloadperl-605aedcce76632b4ab6d032b928335097c11784a.tar.gz
Don’t CLONE nameless hashes
The cloning code was trying to call CLONE on nameless hashes that nonetheless had an effective name (HvENAME). This can happen if a nameless hash is assigned over a stash, as in *foo:: = {} or if a stash is undefined: undef %foo:: (The effective name is how perl tracks the location internally, for the sake of updating MRO caches.)
-rw-r--r--sv.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sv.c b/sv.c
index 39a76b5dd9..5705890ef3 100644
--- a/sv.c
+++ b/sv.c
@@ -11874,7 +11874,7 @@ S_sv_dup_common(pTHX_ const SV *const sstr, CLONE_PARAMS *const param)
: 0;
/* Record stashes for possible cloning in Perl_clone(). */
- if (hvname)
+ if (HvNAME(sstr))
av_push(param->stashes, dstr);
}
}