diff options
author | Larry Wall <lwall@sems.com> | 1996-08-10 15:24:58 +0000 |
---|---|---|
committer | Larry Wall <lwall@sems.com> | 1996-08-10 15:24:58 +0000 |
commit | 760ac839baf413929cd31cc32ffd6dba6b781a81 (patch) | |
tree | 010ae8135426972c27b065782284341c839dc2a0 /pp.c | |
parent | 43cc1d52f97c5f21f3207f045444707e7be33927 (diff) | |
download | perl-760ac839baf413929cd31cc32ffd6dba6b781a81.tar.gz |
perl 5.003_02: [no incremental changelog available]
Diffstat (limited to 'pp.c')
-rw-r--r-- | pp.c | 27 |
1 files changed, 21 insertions, 6 deletions
@@ -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); |