summaryrefslogtreecommitdiff
path: root/mg.c
diff options
context:
space:
mode:
authorMalcolm Beattie <mbeattie@sable.ox.ac.uk>1997-08-11 15:46:29 +0000
committerMalcolm Beattie <mbeattie@sable.ox.ac.uk>1997-08-11 15:46:29 +0000
commit0f15f207c55ce70f46ebbd3be6c3d54763665084 (patch)
treed4cbbe278d8bb662e537d2b219246ee872cb20e6 /mg.c
parent12ca11f6c16e7b63e13bbf5bc251f214e8de5211 (diff)
downloadperl-0f15f207c55ce70f46ebbd3be6c3d54763665084.tar.gz
Assorted changes for multi-threading (now works rather more).
p4raw-id: //depot/perl@44
Diffstat (limited to 'mg.c')
-rw-r--r--mg.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/mg.c b/mg.c
index 960e0c1cd4..305f00f7e5 100644
--- a/mg.c
+++ b/mg.c
@@ -491,7 +491,7 @@ MAGIC *mg;
case '/':
break;
case '[':
- sv_setiv(sv, (IV)curcop->cop_arybase);
+ WITH_THR(sv_setiv(sv, (IV)curcop->cop_arybase));
break;
case '|':
sv_setiv(sv, (IV)(IoFLAGS(GvIOp(defoutgv)) & IOf_FLUSH) != 0 );
@@ -967,6 +967,7 @@ magic_getarylen(sv,mg)
SV* sv;
MAGIC* mg;
{
+ dTHR;
sv_setiv(sv, AvFILL((AV*)mg->mg_obj) + curcop->cop_arybase);
return 0;
}
@@ -976,6 +977,7 @@ magic_setarylen(sv,mg)
SV* sv;
MAGIC* mg;
{
+ dTHR;
av_fill((AV*)mg->mg_obj, SvIV(sv) - curcop->cop_arybase);
return 0;
}
@@ -990,6 +992,7 @@ MAGIC* mg;
if (SvTYPE(lsv) >= SVt_PVMG && SvMAGIC(lsv)) {
mg = mg_find(lsv, 'g');
if (mg && mg->mg_len >= 0) {
+ dTHR;
sv_setiv(sv, mg->mg_len + curcop->cop_arybase);
return 0;
}
@@ -1023,7 +1026,7 @@ MAGIC* mg;
}
len = SvPOK(lsv) ? SvCUR(lsv) : sv_len(lsv);
- pos = SvIV(sv) - curcop->cop_arybase;
+ WITH_THR(pos = SvIV(sv) - curcop->cop_arybase);
if (pos < 0) {
pos += len;
if (pos < 0)