From: Graham Barr Date: Sat, 24 Oct 1998 12:45:21 +0000 (-0500) Subject: Re: Auto-incrementing tied scalar causes SEGV X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b23a5f78ac194f96460ff70d7f7de145efd51801;p=p5sagit%2Fp5-mst-13.2.git Re: Auto-incrementing tied scalar causes SEGV Message-ID: <19981024124521.C512@pobox.com> p4raw-id: //depot/perl@2076 --- diff --git a/sv.c b/sv.c index f0ccae5..ab419e4 100644 --- a/sv.c +++ b/sv.c @@ -3596,6 +3596,8 @@ sv_inc(register SV *sv) if (!sv) return; + if (SvGMAGICAL(sv)) + mg_get(sv); if (SvTHINKFIRST(sv)) { if (SvREADONLY(sv)) { dTHR; @@ -3612,8 +3614,6 @@ sv_inc(register SV *sv) sv_setiv(sv, i); } } - if (SvGMAGICAL(sv)) - mg_get(sv); flags = SvFLAGS(sv); if (flags & SVp_NOK) { (void)SvNOK_only(sv); @@ -3690,6 +3690,8 @@ sv_dec(register SV *sv) if (!sv) return; + if (SvGMAGICAL(sv)) + mg_get(sv); if (SvTHINKFIRST(sv)) { if (SvREADONLY(sv)) { dTHR; @@ -3706,8 +3708,6 @@ sv_dec(register SV *sv) sv_setiv(sv, i); } } - if (SvGMAGICAL(sv)) - mg_get(sv); flags = SvFLAGS(sv); if (flags & SVp_NOK) { SvNVX(sv) -= 1.0;