summaryrefslogtreecommitdiff
path: root/pp_hot.c
diff options
context:
space:
mode:
authorZefram <zefram@fysh.org>2017-12-05 06:13:27 +0000
committerZefram <zefram@fysh.org>2017-12-05 06:21:35 +0000
commit0740a29d60ebd4ff72090340b0140ec2210e90c7 (patch)
treedad4acffe5bffdd0e3b9ddfbb07140218c0bacac /pp_hot.c
parent28ef70489d76deb9024de42a0571162f323148c8 (diff)
downloadperl-0740a29d60ebd4ff72090340b0140ec2210e90c7.tar.gz
stop using &PL_sv_yes as no-op method
Method lookup yields a fake method for ->import or ->unimport if there's no actual method, for historical reasons so that "use" doesn't barf if there's no import method. This fake method used to be &PL_sv_yes being used as a magic placeholder, recognised specially by pp_entersub. But &PL_sv_yes is a string, which we'd expect to serve as a symbolic CV ref. Change method lookup to yield an actual CV with a body in this case, and remove the special case from pp_entersub. This fixes the remaining part of [perl #126042].
Diffstat (limited to 'pp_hot.c')
-rw-r--r--pp_hot.c10
1 files changed, 0 insertions, 10 deletions
diff --git a/pp_hot.c b/pp_hot.c
index 7609638b8f..87e60970d6 100644
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -5007,16 +5007,6 @@ PP(pp_entersub)
if (UNLIKELY(!SvOK(sv)))
DIE(aTHX_ PL_no_usym, "a subroutine");
- if (UNLIKELY(sv == &PL_sv_yes)) { /* unfound import, ignore */
- if (PL_op->op_flags & OPf_STACKED) /* hasargs */
- SP = PL_stack_base + POPMARK;
- else
- (void)POPMARK;
- if (GIMME_V == G_SCALAR)
- PUSHs(&PL_sv_undef);
- RETURN;
- }
-
sym = SvPV_nomg_const(sv, len);
if (PL_op->op_private & HINT_STRICT_REFS)
DIE(aTHX_ "Can't use string (\"%" SVf32 "\"%s) as a subroutine ref while \"strict refs\" in use", sv, len>32 ? "..." : "");