summaryrefslogtreecommitdiff
path: root/gv.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2015-03-01 22:42:04 -0800
committerFather Chrysostomos <sprout@cpan.org>2015-03-01 22:42:26 -0800
commit923ed5809c063091fb0f77dc6f1b8231d587d13e (patch)
treec93b599054d0bc24175c7689e28b0f33b35eb1a6 /gv.c
parentb9c683b3026f8b924b08be79f012dedd1aaa07ad (diff)
downloadperl-923ed5809c063091fb0f77dc6f1b8231d587d13e.tar.gz
[perl #123960] sv.c: Fix gp_free -Do output
We try to print ‘gp_free clearing PL_stashcache for '%"HEKf"'’, but without checking that we actually have a hek. This has been this way since 103f5a36127.
Diffstat (limited to 'gv.c')
-rw-r--r--gv.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/gv.c b/gv.c
index 41cebeb19e..2eb18e4f39 100644
--- a/gv.c
+++ b/gv.c
@@ -2540,9 +2540,12 @@ Perl_gp_free(pTHX_ GV *gv)
Somehow gp->gp_hv can end up pointing at freed garbage. */
if (hv && SvTYPE(hv) == SVt_PVHV) {
const HEK *hvname_hek = HvNAME_HEK(hv);
- DEBUG_o(Perl_deb(aTHX_ "gp_free clearing PL_stashcache for '%"HEKf"'\n", HEKfARG(hvname_hek)));
- if (PL_stashcache && hvname_hek)
+ if (PL_stashcache && hvname_hek) {
+ DEBUG_o(Perl_deb(aTHX_
+ "gp_free clearing PL_stashcache for '%"HEKf"'\n",
+ HEKfARG(hvname_hek)));
(void)hv_deletehek(PL_stashcache, hvname_hek, G_DISCARD);
+ }
SvREFCNT_dec(hv);
}
if (io && SvREFCNT(io) == 1 && IoIFP(io)