diff options
-rw-r--r-- | gv.c | 10 | ||||
-rw-r--r-- | pp.h | 12 |
2 files changed, 9 insertions, 13 deletions
@@ -2313,7 +2313,15 @@ Perl_amagic_call(pTHX_ SV *left, SV *right, int method, int flags) && (assign || (method == inc_amg) || (method == dec_amg))) || force_cpy) { - RvDEEPCP(left); + /* newSVsv does not behave as advertised, so we copy missing + * information by hand */ + SV *tmpRef = SvRV(left); + SV *rv_copy; + if (SvREFCNT(tmpRef) > 1 && (rv_copy = AMG_CALLun(left,copy))) { + SvRV_set(left, rv_copy); + SvSETMAGIC(left); + SvREFCNT_dec(tmpRef); + } } { @@ -482,18 +482,6 @@ Does not use C<TARG>. See also C<XPUSHu>, C<mPUSHu> and C<PUSHu>. { sv_setsv(TARG, (sv)); SETTARG; } \ else SETs(sv); } STMT_END -/* newSVsv does not behave as advertised, so we copy missing - * information by hand */ - -/* SV* ref causes confusion with the member variable - changed SV* ref to SV* tmpRef */ -#define RvDEEPCP(rv) STMT_START { SV* tmpRef=SvRV(rv); SV* rv_copy; \ - if (SvREFCNT(tmpRef)>1 && (rv_copy = AMG_CALLun(rv,copy))) { \ - SvRV_set(rv, rv_copy); \ - SvSETMAGIC(rv); \ - SvREFCNT_dec(tmpRef); \ - } } STMT_END - /* =for apidoc mU||LVRET True if this op will be the return value of an lvalue subroutine |