diff options
-rw-r--r-- | gv.c | 4 | ||||
-rw-r--r-- | hv.c | 2 | ||||
-rw-r--r-- | pp.c | 5 | ||||
-rw-r--r-- | pp_ctl.c | 12 | ||||
-rw-r--r-- | pp_hot.c | 15 | ||||
-rw-r--r-- | pp_sys.c | 2 | ||||
-rw-r--r-- | regexec.c | 2 | ||||
-rw-r--r-- | universal.c | 16 |
8 files changed, 34 insertions, 24 deletions
@@ -3184,7 +3184,7 @@ Perl_amagic_call(pTHX_ SV *left, SV *right, int method, int flags) if (off1==lt_amg) { SV* const lessp = amagic_call(left,nullsv, lt_amg,AMGf_noright); - logic = SvTRUE(lessp); + logic = SvTRUE_NN(lessp); } else { SV* const lessp = amagic_call(left,nullsv, ncmp_amg,AMGf_noright); @@ -3557,7 +3557,7 @@ Perl_amagic_call(pTHX_ SV *left, SV *right, int method, int flags) case dec_amg: SvSetSV(left,res); return left; case not_amg: - ans=!SvTRUE(res); break; + ans=!SvTRUE_NN(res); break; default: ans=0; break; } @@ -509,7 +509,7 @@ Perl_hv_common(pTHX_ HV *hv, SV *keysv, const char *key, STRLEN klen, /* This cast somewhat evil, but I'm merely using NULL/ not NULL to return the boolean exists. And I know hv is not NULL. */ - return SvTRUE(svret) ? (void *)hv : NULL; + return SvTRUE_NN(svret) ? (void *)hv : NULL; } #ifdef ENV_IS_CASELESS else if (mg_find((const SV *)hv, PERL_MAGIC_env)) { @@ -2621,8 +2621,11 @@ PP(pp_negate) PP(pp_not) { dSP; + SV *sv; + tryAMAGICun_MG(not_amg, AMGf_set); - *PL_stack_sp = boolSV(!SvTRUE_nomg(*PL_stack_sp)); + sv = *PL_stack_sp; + *PL_stack_sp = boolSV(!SvTRUE_nomg_NN(sv)); return NORMAL; } @@ -1128,9 +1128,11 @@ PP(pp_mapwhile) PP(pp_range) { + dTARG; if (GIMME_V == G_ARRAY) return NORMAL; - if (SvTRUEx(PAD_SV(PL_op->op_targ))) + GETTARGET; + if (SvTRUE_NN(targ)) return cLOGOP->op_other; else return NORMAL; @@ -1158,7 +1160,7 @@ PP(pp_flip) flip = SvIV(sv) == SvIV(GvSV(gv)); } } else { - flip = SvTRUE(sv); + flip = SvTRUE_NN(sv); } if (flip) { sv_setiv(PAD_SV(cUNOP->op_first->op_targ), 1); @@ -1271,7 +1273,7 @@ PP(pp_flop) } } else { - flop = SvTRUE(sv); + flop = SvTRUE_NN(sv); } if (flop) { @@ -1803,7 +1805,7 @@ Perl_die_unwind(pTHX_ SV *msv) PP(pp_xor) { dSP; dPOPTOPssrl; - if (SvTRUE(left) != SvTRUE(right)) + if (SvTRUE_NN(left) != SvTRUE_NN(right)) RETSETYES; else RETSETNO; @@ -4462,7 +4464,7 @@ PP(pp_leaveeval) /* did require return a false value? */ failed = CxOLD_OP_TYPE(cx) == OP_REQUIRE && !(gimme == G_SCALAR - ? SvTRUE(*PL_stack_sp) + ? SvTRUE_NN(*PL_stack_sp) : PL_stack_sp > oldsp); if (gimme == G_VOID) { @@ -231,11 +231,11 @@ PP(pp_sassign) PP(pp_cond_expr) { dSP; + SV *sv; + PERL_ASYNC_CHECK(); - if (SvTRUEx(POPs)) - RETURNOP(cLOGOP->op_other); - else - RETURNOP(cLOGOP->op_next); + sv = POPs; + RETURNOP(SvTRUE_NN(sv) ? cLOGOP->op_other : cLOGOP->op_next); } PP(pp_unstack) @@ -521,8 +521,10 @@ PP(pp_predec) PP(pp_or) { dSP; + SV *sv; PERL_ASYNC_CHECK(); - if (SvTRUE(TOPs)) + sv = TOPs; + if (SvTRUE_NN(sv)) RETURN; else { if (PL_op->op_type == OP_OR) @@ -3511,8 +3513,9 @@ PP(pp_subst) PP(pp_grepwhile) { dSP; + dPOPss; - if (SvTRUEx(POPs)) + if (SvTRUE_NN(sv)) PL_stack_base[PL_markstack_ptr[-1]++] = PL_stack_base[*PL_markstack_ptr]; ++*PL_markstack_ptr; FREETMPS; @@ -3293,7 +3293,7 @@ PP(pp_ftis) break; } SvSETMAGIC(TARG); - return SvTRUE_nomg(TARG) + return SvTRUE_nomg_NN(TARG) ? S_ft_return_true(aTHX_ TARG) : S_ft_return_false(aTHX_ TARG); } } @@ -6983,7 +6983,7 @@ S_regmatch(pTHX_ regmatch_info *reginfo, char *startpos, regnode *prog) if (logical == 0) /* (?{})/ */ sv_setsv(save_scalar(PL_replgv), ret); /* $^R */ else if (logical == 1) { /* /(?(?{...})X|Y)/ */ - sw = cBOOL(SvTRUE(ret)); + sw = cBOOL(SvTRUE_NN(ret)); logical = 0; } else { /* /(??{}) */ diff --git a/universal.c b/universal.c index be39310da7..6ee65a6a11 100644 --- a/universal.c +++ b/universal.c @@ -233,7 +233,7 @@ Perl_sv_does_sv(pTHX_ SV *sv, SV *namesv, U32 flags) call_sv(methodname, G_SCALAR | G_METHOD); SPAGAIN; - does_it = SvTRUE( TOPs ); + does_it = SvTRUE_NN( TOPs ); FREETMPS; LEAVE; @@ -509,9 +509,10 @@ XS(XS_utf8_downgrade) if (items < 1 || items > 2) croak_xs_usage(cv, "sv, failok=0"); else { - SV * const sv = ST(0); - const bool failok = (items < 2) ? 0 : SvTRUE(ST(1)) ? 1 : 0; - const bool RETVAL = sv_utf8_downgrade(sv, failok); + SV * const sv0 = ST(0); + SV * const sv1 = ST(1); + const bool failok = (items < 2) ? 0 : SvTRUE_NN(sv1) ? 1 : 0; + const bool RETVAL = sv_utf8_downgrade(sv0, failok); ST(0) = boolSV(RETVAL); } @@ -564,7 +565,8 @@ XS(XS_Internals_SvREADONLY) /* This is dangerous stuff. */ XSRETURN_NO; } else if (items == 2) { - if (SvTRUE(ST(1))) { + SV *sv1 = ST(1); + if (SvTRUE_NN(sv1)) { SvFLAGS(sv) |= SVf_READONLY; XSRETURN_YES; } @@ -820,7 +822,7 @@ XS(XS_re_regname) if (!rx) XSRETURN_UNDEF; - if (items == 2 && SvTRUE(ST(1))) { + if (items == 2 && SvTRUE_NN(ST(1))) { flags = RXapif_ALL; } else { flags = RXapif_ONE; @@ -853,7 +855,7 @@ XS(XS_re_regnames) if (!rx) XSRETURN_UNDEF; - if (items == 1 && SvTRUE(ST(0))) { + if (items == 1 && SvTRUE_NN(ST(0))) { flags = RXapif_ALL; } else { flags = RXapif_ONE; |