summaryrefslogtreecommitdiff
path: root/mg.c
diff options
context:
space:
mode:
authorNick Ing-Simmons <nik@tiuk.ti.com>1997-11-07 23:52:35 +0000
committerNick Ing-Simmons <nik@tiuk.ti.com>1997-11-07 23:52:35 +0000
commitaeea060ce4b653ecf5b0731f1cbfcf468f688acd (patch)
tree071ed1fbe63cb80bbddce550bd8c0b9942527b3f /mg.c
parente77eedc24c0252a902559034f2aa207f216529cc (diff)
downloadperl-aeea060ce4b653ecf5b0731f1cbfcf468f688acd.tar.gz
Reverse integrate Malcolm's chanes into local
repository, then import result back into my view of Malcolm's repository. Builds and passes (most) tests with GNU C++/Solaris and Borland C++, Win32. p4raw-id: //depot/ansiperl@210
Diffstat (limited to 'mg.c')
-rw-r--r--mg.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/mg.c b/mg.c
index 5d2702675c..893b5aaba1 100644
--- a/mg.c
+++ b/mg.c
@@ -247,6 +247,7 @@ mg_free(SV *sv)
U32
magic_len(SV *sv, MAGIC *mg)
{
+ dTHR;
register I32 paren;
register char *s;
register I32 i;
@@ -310,6 +311,7 @@ magic_len(SV *sv, MAGIC *mg)
int
magic_get(SV *sv, MAGIC *mg)
{
+ dTHR;
register I32 paren;
register char *s;
register I32 i;
@@ -396,7 +398,11 @@ magic_get(SV *sv, MAGIC *mg)
case '1': case '2': case '3': case '4':
case '5': case '6': case '7': case '8': case '9': case '&':
if (curpm && (rx = curpm->op_pmregexp)) {
- paren = atoi(GvENAME((GV*)mg->mg_obj));
+ /*
+ * Pre-threads, this was paren = atoi(GvENAME((GV*)mg->mg_obj));
+ * XXX Does the new way break anything?
+ */
+ paren = atoi(mg->mg_ptr);
getparen:
if (paren <= rx->nparens &&
(s = rx->startp[paren]) &&
@@ -553,6 +559,11 @@ magic_get(SV *sv, MAGIC *mg)
break;
case '0':
break;
+#ifdef USE_THREADS
+ case '@':
+ sv_setsv(sv, errsv);
+ break;
+#endif /* USE_THREADS */
}
return 0;
}
@@ -718,7 +729,6 @@ magic_getsig(SV *sv, MAGIC *mg)
if(psig_ptr[i])
sv_setsv(sv,psig_ptr[i]);
else {
- dTHR; /* just for SvREFCNT_inc */
Sighandler_t sigstate = rsignal_state(i);
/* cache state so we don't fetch it again */
@@ -1098,6 +1108,7 @@ magic_setsubstr(SV *sv, MAGIC *mg)
int
magic_gettaint(SV *sv, MAGIC *mg)
{
+ dTHR;
TAINT_IF((mg->mg_len & 1) ||
(mg->mg_len & 2) && mg->mg_obj == sv); /* kludge */
return 0;
@@ -1604,6 +1615,11 @@ magic_set(SV *sv, MAGIC *mg)
origargv[i] = Nullch;
}
break;
+#ifdef USE_THREADS
+ case '@':
+ sv_setsv(errsv, sv);
+ break;
+#endif /* USE_THREADS */
}
return 0;
}