From: Gurusamy Sarathy Date: Thu, 24 Sep 1998 06:45:13 +0000 (+0000) Subject: make C AUTOLOAD-aware (autouse now works for modules X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=e8f7dd13f8ad36b160a674831b76d23cb33bfe5a;p=p5sagit%2Fp5-mst-13.2.git make C AUTOLOAD-aware (autouse now works for modules that are autoloaded) p4raw-id: //depot/perl@1867 --- diff --git a/pp_ctl.c b/pp_ctl.c index 48a2ed2..7fcdf3d 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");