diff options
author | David Mitchell <davem@iabyn.com> | 2015-02-26 11:50:19 +0000 |
---|---|---|
committer | David Mitchell <davem@iabyn.com> | 2015-02-26 11:50:19 +0000 |
commit | 6610358143bf27b3aa51a6d6d17d81fe85d7dc31 (patch) | |
tree | 065ad965d15357a28ea60bc325edd24998435865 /dump.c | |
parent | f17ecf24ba6b388a06aaec154fc4ca2d828b860d (diff) | |
download | perl-6610358143bf27b3aa51a6d6d17d81fe85d7dc31.tar.gz |
restate -Dx dumping top-level subs
Commit v5.21.3-638-g2eaf799 made compiled subs that don't have :: in their
name be stored in stashes as refs to CVs rather than as GVs. This
indirectly stopped perl -Dx from dumping such subs.
This commit reinstates the old behaviour by making
Perl_dump_packsubs_perl() upgrade the stash entry to a GV when it finds
an RV->CV.
Diffstat (limited to 'dump.c')
-rw-r--r-- | dump.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -572,7 +572,10 @@ Perl_dump_packsubs_perl(pTHX_ const HV *stash, bool justperl) for (i = 0; i <= (I32) HvMAX(stash); i++) { const HE *entry; for (entry = HvARRAY(stash)[i]; entry; entry = HeNEXT(entry)) { - const GV * const gv = (const GV *)HeVAL(entry); + GV * gv = (GV *)HeVAL(entry); + if (SvROK(gv) && SvTYPE(SvRV(gv)) == SVt_PVCV) + /* unfake a fake GV */ + (void)CvGV(SvRV(gv)); if (SvTYPE(gv) != SVt_PVGV || !GvGP(gv)) continue; if (GvCVu(gv)) |