From e499bb364c2db5d5d50ebeb4678982e3fd5bb282 Mon Sep 17 00:00:00 2001 From: Father Chrysostomos Date: Tue, 22 Nov 2011 13:34:37 -0800 Subject: [PATCH] amagic_deref_call does not necessitate SPAGAIN As amagic_deref_call pushes a new stack, PL_stack_sp will always have the same value before and after, so SPAGAIN is unnecessary. --- pp.c | 4 ---- pp_hot.c | 1 - sv.c | 2 -- 3 files changed, 7 deletions(-) diff --git a/pp.c b/pp.c index 27d6a00..a6e2f4e 100644 --- a/pp.c +++ b/pp.c @@ -147,8 +147,6 @@ static const char S_no_symref_sv[] = When noinit is true, the absence of a gv will cause a retval of undef. This is unrelated to the cv-to-gv assignment case. - - Make sure to use SPAGAIN after calling this. */ static SV * @@ -253,7 +251,6 @@ PP(pp_rv2gv) ((PL_op->op_flags & OPf_SPECIAL) && !(PL_op->op_flags & OPf_MOD)) || PL_op->op_type == OP_READLINE ); - SPAGAIN; if (PL_op->op_private & OPpLVAL_INTRO) save_gp(MUTABLE_GV(sv), !(PL_op->op_flags & OPf_SPECIAL)); SETs(sv); @@ -315,7 +312,6 @@ PP(pp_rv2sv) if (SvROK(sv)) { if (SvAMAGIC(sv)) { sv = amagic_deref_call(sv, to_sv_amg); - SPAGAIN; } sv = SvRV(sv); diff --git a/pp_hot.c b/pp_hot.c index 32b732f..eb8fe4f 100644 --- a/pp_hot.c +++ b/pp_hot.c @@ -771,7 +771,6 @@ PP(pp_rv2av) if (SvROK(sv)) { if (SvAMAGIC(sv)) { sv = amagic_deref_call(sv, is_pp_rv2av ? to_av_amg : to_hv_amg); - SPAGAIN; } sv = SvRV(sv); if (SvTYPE(sv) != type) diff --git a/sv.c b/sv.c index 14ef56b..8d36ebf 100644 --- a/sv.c +++ b/sv.c @@ -8901,8 +8901,6 @@ Perl_sv_2cv(pTHX_ SV *sv, HV **const st, GV **const gvp, const I32 lref) if (SvROK(sv)) { if (SvAMAGIC(sv)) sv = amagic_deref_call(sv, to_cv_amg); - /* At this point I'd like to do SPAGAIN, but really I need to - force it upon my callers. Hmmm. This is a mess... */ sv = SvRV(sv); if (SvTYPE(sv) == SVt_PVCV) { -- 2.7.4