X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=pp.h;h=118c0272019ede94970e5b1a9feb5ca6f2f39f86;hb=76467b2a651c6c83b127a7ee5b8170cd17171b66;hp=7b5f322f1c02fbfc3ff512345dd10f99f929e576;hpb=8f14ea018e8d1f6c6a67be29ee2ae899993d0f0e;p=p5sagit%2Fp5-mst-13.2.git diff --git a/pp.h b/pp.h index 7b5f322..118c027 100644 --- a/pp.h +++ b/pp.h @@ -1,7 +1,7 @@ /* pp.h * - * Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, - * 2001, 2002, 2003, 2004, 2005, 2006, 2007, by Larry Wall and others + * Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, + * 2002, 2003, 2004, 2005, 2006, 2007, 2008 by Larry Wall and others * * You may distribute under the terms of either the GNU General Public * License or the Artistic License, as specified in the README file. @@ -487,9 +487,9 @@ Does not use C. See also C, C and C. /* SV* ref causes confusion with the member variable changed SV* ref to SV* tmpRef */ -#define RvDEEPCP(rv) STMT_START { SV* tmpRef=SvRV(rv); \ - if (SvREFCNT(tmpRef)>1) { \ - SvRV_set(rv, AMG_CALLun(rv,copy)); \ +#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); \ SvREFCNT_dec(tmpRef); \ } } STMT_END @@ -500,6 +500,15 @@ True if this op will be the return value of an lvalue subroutine =cut */ #define LVRET ((PL_op->op_private & OPpMAYBE_LVSUB) && is_lvalue_sub()) +#define SvCANEXISTDELETE(sv) \ + (!SvRMAGICAL(sv) \ + || ((mg = mg_find((const SV *) sv, PERL_MAGIC_tied)) \ + && (stash = SvSTASH(SvRV(SvTIED_obj(MUTABLE_SV(sv), mg)))) \ + && gv_fetchmethod_autoload(stash, "EXISTS", TRUE) \ + && gv_fetchmethod_autoload(stash, "DELETE", TRUE) \ + ) \ + ) + /* * Local variables: * c-indentation-style: bsd