Change 19943 by [EMAIL PROTECTED] on 2003/07/03 06:27:18
Subject: [PATCH] Re: ext/List/Util/t/weak.t panic
From: Dave Mitchell <[EMAIL PROTECTED]>
Date: Thu, 3 Jul 2003 01:32:11 +0100
Message-ID: <[EMAIL PROTECTED]>
Affected files ...
... //depot/perl/mg.c#270 edit
... //depot/perl/sv.c#674 edit
Differences ...
==== //depot/perl/mg.c#270 (text) ====
Index: perl/mg.c
--- perl/mg.c#269~19889~ Mon Jun 30 01:36:38 2003
+++ perl/mg.c Wed Jul 2 23:27:18 2003
@@ -1881,6 +1881,7 @@
}
i--;
}
+ SvREFCNT_dec(av); /* remove extra count added by sv_add_backref() */
return 0;
}
==== //depot/perl/sv.c#674 (text) ====
Index: perl/sv.c
--- perl/sv.c#673~19931~ Wed Jul 2 04:34:49 2003
+++ perl/sv.c Wed Jul 2 23:27:18 2003
@@ -5091,7 +5091,9 @@
else {
av = newAV();
sv_magic(tsv, (SV*)av, PERL_MAGIC_backref, NULL, 0);
- SvREFCNT_dec(av); /* for sv_magic */
+ /* av now has a refcnt of 2, which avoids it getting freed
+ * before us during global cleanup. The extra ref is removed
+ * by magic_killbackrefs() when tsv is being freed */
}
if (AvFILLp(av) >= AvMAX(av)) {
SV **svp = AvARRAY(av);
End of Patch.