summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gv.c10
-rw-r--r--pp.h12
2 files changed, 9 insertions, 13 deletions
diff --git a/gv.c b/gv.c
index f43706c7b2..080db567be 100644
--- a/gv.c
+++ b/gv.c
@@ -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);
+ }
}
{
diff --git a/pp.h b/pp.h
index 56337fc21d..27f948cfdc 100644
--- a/pp.h
+++ b/pp.h
@@ -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