diff options
Diffstat (limited to 'contrib/perl5/pp.h')
-rw-r--r-- | contrib/perl5/pp.h | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/contrib/perl5/pp.h b/contrib/perl5/pp.h index bdc0b1a6c1c9..10da9644924a 100644 --- a/contrib/perl5/pp.h +++ b/contrib/perl5/pp.h @@ -1,6 +1,6 @@ /* pp.h * - * Copyright (c) 1991-2000, Larry Wall + * Copyright (c) 1991-2001, Larry Wall * * You may distribute under the terms of either the GNU General Public * License or the Artistic License, as specified in the README file. @@ -49,6 +49,7 @@ Refetch the stack pointer. Used after a callback. See L<perlcall>. =cut */ +#undef SP /* Solaris 2.7 i386 has this in /usr/include/sys/reg.h */ #define SP sp #define MARK mark #define TARG targ @@ -60,8 +61,8 @@ Refetch the stack pointer. Used after a callback. See L<perlcall>. #define TOPMARK (*PL_markstack_ptr) #define POPMARK (*PL_markstack_ptr--) -#define djSP register SV **sp = PL_stack_sp -#define dSP dTHR; djSP +#define dSP register SV **sp = PL_stack_sp +#define djSP dSP #define dMARK register SV **mark = PL_stack_base + POPMARK #define dORIGMARK I32 origmark = mark - PL_stack_base #define SETORIGMARK origmark = mark - PL_stack_base @@ -143,11 +144,11 @@ Pops a long off the stack. /* =for apidoc Am|void|EXTEND|SP|int nitems Used to extend the argument stack for an XSUB's return values. Once -used, guarrantees that there is room for at least C<nitems> to be pushed +used, guarantees that there is room for at least C<nitems> to be pushed onto the stack. =for apidoc Am|void|PUSHs|SV* sv -Push an SV onto the stack. The stack must have room for this element. +Push an SV onto the stack. The stack must have room for this element. Does not handle 'set' magic. See C<XPUSHs>. =for apidoc Am|void|PUSHp|char* str|STRLEN len @@ -185,7 +186,7 @@ Push an integer onto the stack, extending the stack if necessary. Handles 'set' magic. See C<PUSHi>. =for apidoc Am|void|XPUSHu|UV uv -Push an unsigned integer onto the stack, extending the stack if necessary. +Push an unsigned integer onto the stack, extending the stack if necessary. See C<PUSHu>. =cut @@ -342,10 +343,13 @@ See C<PUSHu>. { dTARGETSTACKED; \ { dSP; tryAMAGICunW(meth,FORCE_SETs,shift,RETURN);}}} -#define setAGAIN(ref) sv = arg = ref; \ - if (!SvROK(ref)) \ +#define setAGAIN(ref) sv = ref; \ + if (!SvROK(ref)) \ Perl_croak(aTHX_ "Overloaded dereference did not return a reference"); \ - goto am_again; + if (ref != arg && SvRV(ref) != SvRV(arg)) { \ + arg = ref; \ + goto am_again; \ + } #define tryAMAGICunDEREF(meth) tryAMAGICunW(meth,setAGAIN,0,(void)0) @@ -370,3 +374,10 @@ See C<PUSHu>. SvREFCNT_dec(tmpRef); \ SvRV(rv)=AMG_CALLun(rv,copy); \ } } STMT_END + +/* +=for apidoc mU||LVRET +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()) |