diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 1999-05-11 14:08:14 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 1999-05-11 14:08:14 +0000 |
commit | f6ec51f74c8ac3114d6ab404cd0d7ce83d50adc9 (patch) | |
tree | 18863e2a1c31485f08ee30a422fb01ce18d80a81 /pp_hot.c | |
parent | a6c403648ecd5cc72235fdb1e7535523a8ff2ac9 (diff) | |
download | perl-f6ec51f74c8ac3114d6ab404cd0d7ce83d50adc9.tar.gz |
avoid creating spurious subroutine stubs on failed subroutine
call and other places of sv_2cv() misuse; fixes problems with
failed subroutine calls "hiding" later attempts to lookup methods
in base classes
p4raw-id: //depot/perl@3388
Diffstat (limited to 'pp_hot.c')
-rw-r--r-- | pp_hot.c | 32 |
1 files changed, 19 insertions, 13 deletions
@@ -2094,10 +2094,13 @@ PP(pp_entersub) break; case SVt_PVGV: if (!(cv = GvCVu((GV*)sv))) - cv = sv_2cv(sv, &stash, &gv, TRUE); - if (cv) - break; - DIE("Not a CODE reference"); + cv = sv_2cv(sv, &stash, &gv, FALSE); + if (!cv) { + ENTER; + SAVETMPS; + goto try_autoload; + } + break; } ENTER; @@ -2117,16 +2120,19 @@ PP(pp_entersub) cv = GvCV(gv); } /* should call AUTOLOAD now? */ - else if ((autogv = gv_autoload4(GvSTASH(gv), GvNAME(gv), GvNAMELEN(gv), - FALSE))) - { - cv = GvCV(autogv); - } - /* sorry */ else { - sub_name = sv_newmortal(); - gv_efullname3(sub_name, gv, Nullch); - DIE("Undefined subroutine &%s called", SvPVX(sub_name)); +try_autoload: + if ((autogv = gv_autoload4(GvSTASH(gv), GvNAME(gv), GvNAMELEN(gv), + FALSE))) + { + cv = GvCV(autogv); + } + /* sorry */ + else { + sub_name = sv_newmortal(); + gv_efullname3(sub_name, gv, Nullch); + DIE("Undefined subroutine &%s called", SvPVX(sub_name)); + } } if (!cv) DIE("Not a CODE reference"); |