diff options
author | David Mitchell <davem@iabyn.com> | 2010-12-16 16:14:06 +0000 |
---|---|---|
committer | David Mitchell <davem@iabyn.com> | 2010-12-16 16:16:14 +0000 |
commit | 93d7320bf7eac5942274854396d4ccc6268106c7 (patch) | |
tree | 279988fd2159c2ea009a71d79d668d18a1f43228 /pp_hot.c | |
parent | 2cf724d498600d69eef0cc9013134e35fd9eff6d (diff) | |
download | perl-93d7320bf7eac5942274854396d4ccc6268106c7.tar.gz |
only call amagic_deref_call() if we have to
Diffstat (limited to 'pp_hot.c')
-rw-r--r-- | pp_hot.c | 13 |
1 files changed, 8 insertions, 5 deletions
@@ -827,9 +827,10 @@ PP(pp_rv2av) if (!(PL_op->op_private & OPpDEREFed)) SvGETMAGIC(sv); if (SvROK(sv)) { - sv = amagic_deref_call(sv, is_pp_rv2av ? to_av_amg : to_hv_amg); - SPAGAIN; - + 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) DIE(aTHX_ "Not %s reference", is_pp_rv2av ? an_array : a_hash); @@ -2794,8 +2795,10 @@ PP(pp_entersub) } SvGETMAGIC(sv); if (SvROK(sv)) { - sv = amagic_deref_call(sv, to_cv_amg); - /* Don't SPAGAIN here. */ + if (SvAMAGIC(sv)) { + sv = amagic_deref_call(sv, to_cv_amg); + /* Don't SPAGAIN here. */ + } } else { const char *sym; |