From: Stephen McCamant Date: Mon, 6 Jul 1998 21:22:17 +0000 (-0500) Subject: Re: Inconsistent arithmetics on refs X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b5be31e977337013082e02b64d1c4513c158d1e6;p=p5sagit%2Fp5-mst-13.2.git Re: Inconsistent arithmetics on refs Message-ID: <13729.33816.311236.995647@alias-2.pr.mcs.net> p4raw-id: //depot/perl@1361 --- diff --git a/sv.c b/sv.c index 0ff19a2..f37989e 100644 --- a/sv.c +++ b/sv.c @@ -3442,10 +3442,13 @@ sv_inc(register SV *sv) croak(no_modify); } if (SvROK(sv)) { + IV i; #ifdef OVERLOAD - if (SvAMAGIC(sv) && AMG_CALLun(sv,inc)) return; + if (SvAMAGIC(sv) && AMG_CALLun(sv,inc)) return; #endif /* OVERLOAD */ - sv_unref(sv); + i = (IV)SvRV(sv); + sv_unref(sv); + sv_setiv(sv, i); } } if (SvGMAGICAL(sv)) @@ -3519,10 +3522,13 @@ sv_dec(register SV *sv) croak(no_modify); } if (SvROK(sv)) { + IV i; #ifdef OVERLOAD - if (SvAMAGIC(sv) && AMG_CALLun(sv,dec)) return; + if (SvAMAGIC(sv) && AMG_CALLun(sv,dec)) return; #endif /* OVERLOAD */ - sv_unref(sv); + i = (IV)SvRV(sv); + sv_unref(sv); + sv_setiv(sv, i); } } if (SvGMAGICAL(sv))