summaryrefslogtreecommitdiff
path: root/dump.c
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2015-02-26 11:50:19 +0000
committerDavid Mitchell <davem@iabyn.com>2015-02-26 11:50:19 +0000
commit6610358143bf27b3aa51a6d6d17d81fe85d7dc31 (patch)
tree065ad965d15357a28ea60bc325edd24998435865 /dump.c
parentf17ecf24ba6b388a06aaec154fc4ca2d828b860d (diff)
downloadperl-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.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/dump.c b/dump.c
index 24ce93ed09..9587668865 100644
--- a/dump.c
+++ b/dump.c
@@ -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))