summaryrefslogtreecommitdiff
path: root/pp_hot.c
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>1999-05-11 14:08:14 +0000
committerGurusamy Sarathy <gsar@cpan.org>1999-05-11 14:08:14 +0000
commitf6ec51f74c8ac3114d6ab404cd0d7ce83d50adc9 (patch)
tree18863e2a1c31485f08ee30a422fb01ce18d80a81 /pp_hot.c
parenta6c403648ecd5cc72235fdb1e7535523a8ff2ac9 (diff)
downloadperl-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.c32
1 files changed, 19 insertions, 13 deletions
diff --git a/pp_hot.c b/pp_hot.c
index deb4985c49..5fa2bef7b9 100644
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -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");