summaryrefslogtreecommitdiff
path: root/sv.c
diff options
context:
space:
mode:
authorGraham Barr <gbarr@pobox.com>1998-10-24 07:45:21 -0500
committerGurusamy Sarathy <gsar@cpan.org>1998-10-25 08:37:49 +0000
commitb23a5f78ac194f96460ff70d7f7de145efd51801 (patch)
tree24a23d75b93648488e4732bbdc0d91e0a6a8ef19 /sv.c
parente0587a03b6ac758d47dfaaf71fafbe8f164a1bd5 (diff)
downloadperl-b23a5f78ac194f96460ff70d7f7de145efd51801.tar.gz
Re: Auto-incrementing tied scalar causes SEGV
Message-ID: <19981024124521.C512@pobox.com> p4raw-id: //depot/perl@2076
Diffstat (limited to 'sv.c')
-rw-r--r--sv.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sv.c b/sv.c
index f0ccae54e0..ab419e4513 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;