summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gv.c4
-rw-r--r--hv.c7
-rw-r--r--pp_ctl.c6
-rw-r--r--pp_sys.c10
4 files changed, 14 insertions, 13 deletions
diff --git a/gv.c b/gv.c
index 5da09dfe77..9038764719 100644
--- a/gv.c
+++ b/gv.c
@@ -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;
diff --git a/hv.c b/hv.c
index 3da7910d50..b00712b77d 100644
--- a/hv.c
+++ b/hv.c
@@ -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;
}
diff --git a/pp_ctl.c b/pp_ctl.c
index db5eabea53..b2624d6809 100644
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -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);
}
diff --git a/pp_sys.c b/pp_sys.c
index 100762c1b7..e6ed385d65 100644
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -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);