summaryrefslogtreecommitdiff
path: root/hv.c
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>2007-06-29 09:00:32 +0000
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2007-06-29 09:00:32 +0000
commit0fa56319bf436f5bc52860b8491e91269fb41056 (patch)
tree6ce2bf3a62522458b139993cedfffb934e42daf3 /hv.c
parentfdef73f9d3c637571d3ab9a9d73990f87b1ad2d9 (diff)
downloadperl-0fa56319bf436f5bc52860b8491e91269fb41056.tar.gz
Revert change #31489.
That change was adding a hook to cope with the case when one was undef'ining *ISA globs, in order to clean up correctly. However, this broke the case where one was assiging an array ref to @ISA, which is likely to be more common. Conclusion: don't undef *ISA. (or more generally don't undef globs that contain magical variables) p4raw-link: @31489 on //depot/perl: 5be5c7a687aa37f2ea9dec7988eb57cad1f1ec24 p4raw-id: //depot/perl@31502
Diffstat (limited to 'hv.c')
-rw-r--r--hv.c28
1 files changed, 3 insertions, 25 deletions
diff --git a/hv.c b/hv.c
index adbfbdf0e0..cf0f3f4524 100644
--- a/hv.c
+++ b/hv.c
@@ -1518,19 +1518,12 @@ Perl_hv_free_ent(pTHX_ HV *hv, register HE *entry)
{
dVAR;
SV *val;
- I32 isa_changing = 0;
if (!entry)
return;
val = HeVAL(entry);
-
- if(HvNAME_get(hv) && val && isGV(val)) {
- if(GvCVu((GV*)val))
- mro_method_changed_in(hv); /* deletion of method from stash */
- else if(GvAV((GV*)val) && strEQ(GvNAME((GV*)val), "ISA"))
- isa_changing = 1;
- }
-
+ if (val && isGV(val) && GvCVu(val) && HvNAME_get(hv))
+ mro_method_changed_in(hv); /* deletion of method from stash */
SvREFCNT_dec(val);
if (HeKLEN(entry) == HEf_SVKEY) {
SvREFCNT_dec(HeKEY_sv(entry));
@@ -1541,8 +1534,6 @@ Perl_hv_free_ent(pTHX_ HV *hv, register HE *entry)
else
Safefree(HeKEY_hek(entry));
del_HE(entry);
-
- if(isa_changing) mro_isa_changed_in(hv); /* deletion of @ISA from stash */
}
void
@@ -1853,21 +1844,8 @@ Perl_hv_undef(pTHX_ HV *hv)
DEBUG_A(Perl_hv_assert(aTHX_ hv));
xhv = (XPVHV*)SvANY(hv);
- /* If it's a stash, undef the @ISA and call
- mro_isa_changed_in before proceeding with
- the rest of the destruction */
- if ((name = HvNAME_get(hv)) && !PL_dirty) {
- GV** gvp;
- GV* gv;
- AV* isa;
-
- gvp = (GV**)hv_fetchs(hv, "ISA", FALSE);
- gv = gvp ? *gvp : NULL;
- isa = (gv && isGV_with_GP(gv)) ? GvAV(gv) : NULL;
-
- if(isa) av_undef(isa);
+ if ((name = HvNAME_get(hv)) && !PL_dirty)
mro_isa_changed_in(hv);
- }
hfreeentries(hv);
if (name) {