diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 1998-09-24 06:45:13 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 1998-09-24 06:45:13 +0000 |
commit | e8f7dd13f8ad36b160a674831b76d23cb33bfe5a (patch) | |
tree | e7d2deb3133fad1640fa0bbc2776f5d2025ef4da /pp_ctl.c | |
parent | 4810e5ece3e68c794a2f5f4b442ae6ee99d4998f (diff) | |
download | perl-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.c | 17 |
1 files changed, 14 insertions, 3 deletions
@@ -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"); |