summaryrefslogtreecommitdiff
path: root/gv.c
diff options
context:
space:
mode:
authorIlmari Karonen <iltzu@sci.fi>2002-04-05 04:35:08 +0300
committerJarkko Hietaniemi <jhi@iki.fi>2002-04-04 22:28:32 +0000
commite189a56d832d31da4b6bb0fcf7dfde76e1fc4b24 (patch)
tree290bc6b9dcfe2bba19cd69e7bab20c443d36f81f /gv.c
parentd2c6a9c992e9b88df38dd76d2e704ace83a46bdc (diff)
downloadperl-e189a56d832d31da4b6bb0fcf7dfde76e1fc4b24.tar.gz
Re: [ID 20020305.025] PACKAGE::SUPER doesn't work anymore
Message-ID: <Pine.SOL.3.96.1020405004632.9372C-100000@simpukka> p4raw-id: //depot/perl@15737
Diffstat (limited to 'gv.c')
-rw-r--r--gv.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/gv.c b/gv.c
index 09210956da..a89e900bf8 100644
--- a/gv.c
+++ b/gv.c
@@ -422,9 +422,17 @@ Perl_gv_fetchmethod_autoload(pTHX_ HV *stash, const char *name, I32 autoload)
DEBUG_o( Perl_deb(aTHX_ "Treating %s as %s::%s\n",
origname, HvNAME(stash), name) );
}
- else
+ else {
/* don't autovifify if ->NoSuchStash::method */
stash = gv_stashpvn(origname, nsplit - origname, FALSE);
+
+ /* however, explicit calls to Pkg::SUPER::method may
+ happen, and may require autovivification to work */
+ if (!stash && (nsplit - origname) >= 7 &&
+ strnEQ(nsplit - 7, "::SUPER", 7) &&
+ gv_stashpvn(origname, nsplit - origname - 7, FALSE))
+ stash = gv_stashpvn(origname, nsplit - origname, TRUE);
+ }
}
gv = gv_fetchmeth(stash, name, nend - name, 0);