summaryrefslogtreecommitdiff
path: root/sv.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2005-12-30 16:53:39 +0000
committerNicholas Clark <nick@ccl4.org>2005-12-30 16:53:39 +0000
commit5b285ea4a6ead2df7b4a0a11b0aff949429e0500 (patch)
tree2c57c3e9f4ca7311811702b602feb05f3d1ef697 /sv.c
parentd7cbc7b5c258cffaf362ecafb36c5dfc354c1ffa (diff)
downloadperl-5b285ea4a6ead2df7b4a0a11b0aff949429e0500.tar.gz
Document why it's a bad plan to move the backreferences array from
the magic structure to the hv_aux structure during backreference deletion. Add an optimisation for an empty backreference array. p4raw-id: //depot/perl@26542
Diffstat (limited to 'sv.c')
-rw-r--r--sv.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sv.c b/sv.c
index 3e3bb18fa8..5372215d4d 100644
--- a/sv.c
+++ b/sv.c
@@ -4409,6 +4409,10 @@ S_sv_del_backref(pTHX_ SV *tsv, SV *sv)
if (SvTYPE(tsv) == SVt_PVHV && SvOOK(tsv)) {
av = *Perl_hv_backreferences_p(aTHX_ (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