summaryrefslogtreecommitdiff
path: root/pp_ctl.c
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>1998-09-24 06:45:13 +0000
committerGurusamy Sarathy <gsar@cpan.org>1998-09-24 06:45:13 +0000
commite8f7dd13f8ad36b160a674831b76d23cb33bfe5a (patch)
treee7d2deb3133fad1640fa0bbc2776f5d2025ef4da /pp_ctl.c
parent4810e5ece3e68c794a2f5f4b442ae6ee99d4998f (diff)
downloadperl-e8f7dd13f8ad36b160a674831b76d23cb33bfe5a.tar.gz
make C<goto &sub> AUTOLOAD-aware (autouse now works for modules
that are autoloaded) p4raw-id: //depot/perl@1867
Diffstat (limited to 'pp_ctl.c')
-rw-r--r--pp_ctl.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/pp_ctl.c b/pp_ctl.c
index 48a2ed294c..7fcdf3de51 100644
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -1874,10 +1874,21 @@ PP(pp_goto)
I32 items = 0;
I32 oldsave;
+ retry:
if (!CvROOT(cv) && !CvXSUB(cv)) {
- if (CvGV(cv)) {
- SV *tmpstr = sv_newmortal();
- gv_efullname3(tmpstr, CvGV(cv), Nullch);
+ GV *gv = CvGV(cv);
+ GV *autogv;
+ if (gv) {
+ SV *tmpstr;
+ /* autoloaded stub? */
+ if (cv != GvCV(gv) && (cv = GvCV(gv)))
+ goto retry;
+ autogv = gv_autoload4(GvSTASH(gv), GvNAME(gv),
+ GvNAMELEN(gv), FALSE);
+ if (autogv && (cv = GvCV(autogv)))
+ goto retry;
+ tmpstr = sv_newmortal();
+ gv_efullname3(tmpstr, gv, Nullch);
DIE("Goto undefined subroutine &%s",SvPVX(tmpstr));
}
DIE("Goto undefined subroutine");