amagic_deref_call does not necessitate SPAGAIN
authorFather Chrysostomos <sprout@cpan.org>
Tue, 22 Nov 2011 21:34:37 +0000 (13:34 -0800)
committerFather Chrysostomos <sprout@cpan.org>
Wed, 23 Nov 2011 05:29:33 +0000 (21:29 -0800)
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
pp_hot.c
sv.c

diff --git a/pp.c b/pp.c
index 27d6a00..a6e2f4e 100644 (file)
--- 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);
index 32b732f..eb8fe4f 100644 (file)
--- 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 (file)
--- 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) {