summaryrefslogtreecommitdiff
path: root/pp.c
diff options
context:
space:
mode:
authorLarry Wall <lwall@sems.com>1996-08-10 15:24:58 +0000
committerLarry Wall <lwall@sems.com>1996-08-10 15:24:58 +0000
commit760ac839baf413929cd31cc32ffd6dba6b781a81 (patch)
tree010ae8135426972c27b065782284341c839dc2a0 /pp.c
parent43cc1d52f97c5f21f3207f045444707e7be33927 (diff)
downloadperl-760ac839baf413929cd31cc32ffd6dba6b781a81.tar.gz
perl 5.003_02: [no incremental changelog available]
Diffstat (limited to 'pp.c')
-rw-r--r--pp.c27
1 files changed, 21 insertions, 6 deletions
diff --git a/pp.c b/pp.c
index 03685cb1e0..5b6af5a3fc 100644
--- a/pp.c
+++ b/pp.c
@@ -570,8 +570,13 @@ PP(pp_predec)
{
dSP;
if (SvIOK(TOPs)) {
- --SvIVX(TOPs);
- SvFLAGS(TOPs) &= ~(SVf_NOK|SVf_POK|SVp_NOK|SVp_POK);
+ if (SvIVX(TOPs) == PERL_LONG_MIN) {
+ sv_setnv(TOPs, (double)SvIVX(TOPs) - 1.0);
+ }
+ else {
+ --SvIVX(TOPs);
+ SvFLAGS(TOPs) &= ~(SVf_NOK|SVf_POK|SVp_NOK|SVp_POK);
+ }
}
else
sv_dec(TOPs);
@@ -584,8 +589,13 @@ PP(pp_postinc)
dSP; dTARGET;
sv_setsv(TARG, TOPs);
if (SvIOK(TOPs)) {
- ++SvIVX(TOPs);
- SvFLAGS(TOPs) &= ~(SVf_NOK|SVf_POK|SVp_NOK|SVp_POK);
+ if (SvIVX(TOPs) == PERL_LONG_MAX) {
+ sv_setnv(TOPs, (double)SvIVX(TOPs) + 1.0);
+ }
+ else {
+ ++SvIVX(TOPs);
+ SvFLAGS(TOPs) &= ~(SVf_NOK|SVf_POK|SVp_NOK|SVp_POK);
+ }
}
else
sv_inc(TOPs);
@@ -601,8 +611,13 @@ PP(pp_postdec)
dSP; dTARGET;
sv_setsv(TARG, TOPs);
if (SvIOK(TOPs)) {
- --SvIVX(TOPs);
- SvFLAGS(TOPs) &= ~(SVf_NOK|SVf_POK|SVp_NOK|SVp_POK);
+ if (SvIVX(TOPs) == PERL_LONG_MIN) {
+ sv_setnv(TOPs, (double)SvIVX(TOPs) - 1.0);
+ }
+ else {
+ --SvIVX(TOPs);
+ SvFLAGS(TOPs) &= ~(SVf_NOK|SVf_POK|SVp_NOK|SVp_POK);
+ }
}
else
sv_dec(TOPs);