X-Git-Url: https://perl5.git.perl.org/perl5.git/blobdiff_plain/75ea7a126f0cb23a33771013529ef0e381ffe55d..772d5078e19623501bc9e2e30401b270f2b64bcc:/pp.h diff --git a/pp.h b/pp.h index ca45f61..ad71668 100644 --- a/pp.h +++ b/pp.h @@ -355,10 +355,9 @@ Does not use C. See also C, C and C. SV *leftsv = CAT2(X,s); \ IV left = USE_LEFT(leftsv) ? SvIV(leftsv) : 0 #define dPOPXiirl_ul_nomg(X) \ - SV *rightsv = POPs; \ + IV right = (sp--, SvIV_nomg(TOPp1s)); \ SV *leftsv = CAT2(X,s); \ - IV left = USE_LEFT(leftsv) ? SvIV_nomg(leftsv) : 0; \ - IV right = SvIV_nomg(rightsv) + IV left = USE_LEFT(leftsv) ? SvIV_nomg(leftsv) : 0 #define dPOPPOPssrl dPOPXssrl(POP) #define dPOPPOPnnrl dPOPXnnrl(POP) @@ -371,17 +370,11 @@ Does not use C. See also C, C and C. #define dPOPTOPnnrl_ul dPOPXnnrl_ul(TOP) #define dPOPTOPnnrl_nomg \ NV right = SvNV_nomg(TOPs); NV left = (sp--, SvNV_nomg(TOPs)) -#ifdef PERL_CORE -# define dPOPTOPnnrl_halfmg \ - NV left = SvNV_nomg(TOPm1s); \ - NV right = TOPs == TOPm1s ? SvNV(TOPs) : SvNV_nomg(TOPs); sp-- -#endif #define dPOPTOPiirl dPOPXiirl(TOP) #define dPOPTOPiirl_ul dPOPXiirl_ul(TOP) #define dPOPTOPiirl_ul_nomg dPOPXiirl_ul_nomg(TOP) #define dPOPTOPiirl_nomg \ - IV left = SvIV_nomg(TOPm1s); \ - IV right = (sp--, TOPp1s == TOPs ? SvIV(TOPs) : SvIV_nomg(TOPp1s)) + IV right = SvIV_nomg(TOPs); IV left = (sp--, SvIV_nomg(TOPs)) #define RETPUSHYES RETURNX(PUSHs(&PL_sv_yes)) #define RETPUSHNO RETURNX(PUSHs(&PL_sv_no)) @@ -455,8 +448,12 @@ Does not use C. See also C, C and C. SETTARG; \ PUTBACK; \ if (jump) { \ + OP *jump_o = NORMAL->op_next; \ + while (jump_o->op_type == OP_NULL) \ + jump_o = jump_o->op_next; \ + assert(jump_o->op_type == OP_ENTERSUB); \ PL_markstack_ptr--; \ - return NORMAL->op_next->op_next; \ + return jump_o->op_next; \ } \ return NORMAL; \ } \ @@ -499,12 +496,28 @@ True if this op will be the return value of an lvalue subroutine ) #ifdef PERL_CORE + /* These are just for Perl_tied_method(), which is not part of the public API. Use 0x04 rather than the next available bit, to help the compiler if the architecture can generate more efficient instructions. */ # define TIED_METHOD_MORTALIZE_NOT_NEEDED 0x04 # define TIED_METHOD_ARGUMENTS_ON_STACK 0x08 # define TIED_METHOD_SAY 0x10 + +/* Used in various places that need to dereference a glob or globref */ +# define MAYBE_DEREF_GV_flags(sv,phlags) \ + ( \ + (void)(phlags & SV_GMAGIC && (SvGETMAGIC(sv),0)), \ + isGV_with_GP(sv) \ + ? (GV *)sv \ + : SvROK(sv) && SvTYPE(SvRV(sv)) <= SVt_PVLV && \ + (SvGETMAGIC(SvRV(sv)), isGV_with_GP(SvRV(sv))) \ + ? (GV *)SvRV(sv) \ + : NULL \ + ) +# define MAYBE_DEREF_GV(sv) MAYBE_DEREF_GV_flags(sv,SV_GMAGIC) +# define MAYBE_DEREF_GV_nomg(sv) MAYBE_DEREF_GV_flags(sv,0) + #endif /*