This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Document why it's a bad plan to move the backreferences array from
[perl5.git] / sv.c
diff --git a/sv.c b/sv.c
index 3e3bb18..5372215 100644 (file)
--- 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