diff options
author | Chip Salzenberg <chip@perl.com> | 1997-04-03 10:03:18 +1200 |
---|---|---|
committer | Chip Salzenberg <chip@atlantic.net> | 1997-04-03 10:03:25 +1200 |
commit | 09280a334577a8254c4115b822e1f8cc667611a1 (patch) | |
tree | 5248ec052bcee25ef7a4efc61f20a99d7e7a04e8 /gv.c | |
parent | 8523fd8370f87f8e7cc44b73b86edff69f32270d (diff) | |
download | perl-09280a334577a8254c4115b822e1f8cc667611a1.tar.gz |
Fix AUTOLOAD, or kill me
Diffstat (limited to 'gv.c')
-rw-r--r-- | gv.c | 15 |
1 files changed, 13 insertions, 2 deletions
@@ -285,8 +285,19 @@ I32 autoload; } else if (autoload) { CV* cv = GvCV(gv); - if (!cv || (!CvROOT(cv) && !CvXSUB(cv))) { - GV* autogv = gv_autoload4(GvSTASH(gv), name, nend - name, TRUE); + if (!CvROOT(cv) && !CvXSUB(cv)) { + GV* stubgv; + GV* autogv; + + if (CvANON(cv)) + stubgv = gv; + else { + stubgv = CvGV(cv); + if (GvCV(stubgv) != cv) /* orphaned import */ + stubgv = gv; + } + autogv = gv_autoload4(GvSTASH(stubgv), + GvNAME(stubgv), GvNAMELEN(stubgv), TRUE); if (autogv) gv = autogv; } |