summaryrefslogtreecommitdiff
path: root/sv.c
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2010-07-29 13:23:22 +0100
committerDavid Mitchell <davem@iabyn.com>2010-07-29 13:23:22 +0100
commit317ec34c4f2f5d6276d12392ee09cb99461cefd0 (patch)
tree92c7a121f2c5b4cf99d5f48b8d58690e3e87e637 /sv.c
parent1c480c903473b013658c29213ac3d1772ab6b63a (diff)
downloadperl-317ec34c4f2f5d6276d12392ee09cb99461cefd0.tar.gz
Revert "make it an error to look for magic hv backref"
This reverts commit 64345bb5cdba725a5e2af06c99aa36d8a1b8b873.
Diffstat (limited to 'sv.c')
-rw-r--r--sv.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/sv.c b/sv.c
index b2383fd536..c76235747a 100644
--- a/sv.c
+++ b/sv.c
@@ -5373,16 +5373,14 @@ Perl_sv_del_backref(pTHX_ SV *const tsv, SV *const sv)
PERL_ARGS_ASSERT_SV_DEL_BACKREF;
- if (SvTYPE(tsv) == SVt_PVHV) {
- if (SvOOK(tsv)) {
- /* SvOOK: We must avoid creating the hv_aux structure if its
- * not already there, as that is stored in the main HvARRAY(),
- * and hfreentries assumes that no-one reallocates HvARRAY()
- * while it is running. */
- av = *Perl_hv_backreferences_p(aTHX_ MUTABLE_HV(tsv));
- }
- }
- else {
+ if (SvTYPE(tsv) == SVt_PVHV && SvOOK(tsv)) {
+ av = *Perl_hv_backreferences_p(aTHX_ MUTABLE_HV(tsv));
+ /* We mustn't attempt to "fix up" the hash here by moving the
+ backreference array back to the hv_aux structure, as that is stored
+ in the main HvARRAY(), and hfreentries assumes that no-one
+ reallocates HvARRAY() while it is running. */
+ }
+ if (!av) {
const MAGIC *const mg
= SvMAGICAL(tsv) ? mg_find(tsv, PERL_MAGIC_backref) : NULL;
if (mg)