summaryrefslogtreecommitdiff
path: root/gv.c
diff options
context:
space:
mode:
authorArtur Bergman <sky@nanisky.com>2003-04-14 21:15:00 +0000
committerArtur Bergman <sky@nanisky.com>2003-04-14 21:15:00 +0000
commit7e8961ecc77ac069ddd54d220ef48fd89f1122d6 (patch)
tree8e4a939671b8c9010c43b51fcf99f7cc2698363f /gv.c
parent00bf5cd963bef6a3dffb6f796fe06e66184d13f0 (diff)
downloadperl-7e8961ecc77ac069ddd54d220ef48fd89f1122d6.tar.gz
Fixes to bugs introduced by PL_stashcache
A) Follow suggestion by Benjamin Goldberg to use hv_delete instead of hv_delete_ent to avoid creating a temporary SV B) Don't increment the refcount, sneak it into an IV instead C) When a GP is a deleted that contains a stash, remove the corresponding entry since hv might be in use in other places. D) Note that no test cases test the deletion of packages to catch this bug. p4raw-id: //depot/perl@19212
Diffstat (limited to 'gv.c')
-rw-r--r--gv.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/gv.c b/gv.c
index 7d21f02d15..0788dd67c4 100644
--- a/gv.c
+++ b/gv.c
@@ -1240,6 +1240,8 @@ Perl_gp_free(pTHX_ GV *gv)
SvREFCNT_dec(gp->gp_sv);
SvREFCNT_dec(gp->gp_av);
+ if(gp->gp_hv && PL_stashcache)
+ hv_delete(PL_stashcache, HvNAME(gp->gp_hv), strlen(HvNAME(gp->gp_hv)), G_DISCARD);
SvREFCNT_dec(gp->gp_hv);
SvREFCNT_dec(gp->gp_io);
SvREFCNT_dec(gp->gp_cv);