diff options
-rw-r--r-- | gv.c | 4 | ||||
-rw-r--r-- | hv.c | 7 | ||||
-rw-r--r-- | pp_ctl.c | 6 | ||||
-rw-r--r-- | pp_sys.c | 10 |
4 files changed, 14 insertions, 13 deletions
@@ -3180,7 +3180,7 @@ Perl_amagic_call(pTHX_ SV *left, SV *right, int method, int flags) case abs_amg: if ((cvp[off1=lt_amg] || cvp[off1=ncmp_amg]) && ((cv = cvp[off=neg_amg]) || (cv = cvp[off=subtr_amg]))) { - SV* const nullsv=sv_2mortal(newSViv(0)); + SV* const nullsv=&PL_sv_zero; if (off1==lt_amg) { SV* const lessp = amagic_call(left,nullsv, lt_amg,AMGf_noright); @@ -3204,7 +3204,7 @@ Perl_amagic_call(pTHX_ SV *left, SV *right, int method, int flags) case neg_amg: if ((cv = cvp[off=subtr_amg])) { right = left; - left = sv_2mortal(newSViv(0)); + left = &PL_sv_zero; lr = 1; } break; @@ -995,12 +995,13 @@ Perl_hv_bucket_ratio(pTHX_ HV *hv) return magic_scalarpack(hv, mg); } - sv = sv_newmortal(); - if (HvUSEDKEYS((HV *)hv)) + if (HvUSEDKEYS((HV *)hv)) { + sv = sv_newmortal(); Perl_sv_setpvf(aTHX_ sv, "%ld/%ld", (long)HvFILL(hv), (long)HvMAX(hv) + 1); + } else - sv_setiv(sv, 0); + sv = &PL_sv_zero; return sv; } @@ -958,7 +958,7 @@ PP(pp_grepstart) if (PL_stack_base + TOPMARK == SP) { (void)POPMARK; if (GIMME_V == G_SCALAR) - mXPUSHi(0); + XPUSHs(&PL_sv_zero); RETURNOP(PL_op->op_next->op_next); } PL_stack_sp = PL_stack_base + TOPMARK + 1; @@ -1945,7 +1945,7 @@ PP(pp_caller) } else { PUSHs(newSVpvs_flags("(eval)", SVs_TEMP)); - mPUSHi(0); + PUSHs(&PL_sv_zero); } gimme = cx->blk_gimme; if (gimme == G_VOID) @@ -5634,7 +5634,7 @@ S_run_user_filter(pTHX_ int idx, SV *buf_sv, int maxlen) DEFSV_set(upstream); PUSHMARK(SP); - mPUSHi(0); + PUSHs(&PL_sv_zero); if (filter_state) { PUSHs(filter_state); } @@ -655,7 +655,7 @@ PP(pp_open) if (ok) PUSHi( (I32)PL_forkprocess ); else if (PL_forkprocess == 0) /* we are a new child */ - PUSHi(0); + PUSHs(&PL_sv_zero); else RETPUSHUNDEF; RETURN; @@ -3660,7 +3660,7 @@ PP(pp_chdir) "chdir() on unopened filehandle %" SVf, sv); } SETERRNO(EBADF,RMS_IFI); - PUSHi(0); + PUSHs(&PL_sv_zero); TAINT_PROPER("chdir"); RETURN; } @@ -3683,7 +3683,7 @@ PP(pp_chdir) tmps = SvPV_nolen_const(*svp); } else { - PUSHi(0); + PUSHs(&PL_sv_zero); SETERRNO(EINVAL, LIB_INVARG); TAINT_PROPER("chdir"); RETURN; @@ -3728,7 +3728,7 @@ PP(pp_chdir) nuts: report_evil_fh(gv); SETERRNO(EBADF,RMS_IFI); - PUSHi(0); + PUSHs(&PL_sv_zero); RETURN; #endif } @@ -4871,7 +4871,7 @@ PP(pp_sleep) Perl_ck_warner_d(aTHX_ packWARN(WARN_MISC), "sleep() with negative argument"); SETERRNO(EINVAL, LIB_INVARG); - XPUSHi(0); + XPUSHs(&PL_sv_zero); RETURN; } else { PerlProc_sleep((unsigned int)duration); |