summaryrefslogtreecommitdiff
path: root/mg.c
diff options
context:
space:
mode:
authorMalcolm Beattie <mbeattie@sable.ox.ac.uk>1997-10-31 18:05:31 +0000
committerMalcolm Beattie <mbeattie@sable.ox.ac.uk>1997-10-31 18:05:31 +0000
commita863c7d16499251f020c5d26d232aa865fa0b197 (patch)
tree9a4ae00010863431f84e1aa26d6e2cefe89dd514 /mg.c
parent46930d8f1568c61dcd2ab37f6a2924dc79596ffc (diff)
downloadperl-a863c7d16499251f020c5d26d232aa865fa0b197.tar.gz
Half way through moving per-thread magicals into per-thread fields
and the associated new OP_SPECIFIC and find_thread_magical stuff. perl will compile but plenty of the magicals are still broken. p4raw-id: //depot/perl@195
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 7f49f68aa0..47e05a1176 100644
--- a/mg.c
+++ b/mg.c
@@ -264,6 +264,7 @@ magic_len(sv, mg)
SV *sv;
MAGIC *mg;
{
+ dTHR;
register I32 paren;
register char *s;
register I32 i;
@@ -329,6 +330,7 @@ magic_get(sv, mg)
SV *sv;
MAGIC *mg;
{
+ dTHR;
register I32 paren;
register char *s;
register I32 i;
@@ -415,7 +417,11 @@ 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]) &&
@@ -572,6 +578,11 @@ MAGIC *mg;
break;
case '0':
break;
+#ifdef USE_THREADS
+ case '@':
+ sv_setsv(sv, errsv);
+ break;
+#endif /* USE_THREADS */
}
return 0;
}
@@ -749,7 +760,6 @@ 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 */
@@ -1177,6 +1187,7 @@ magic_gettaint(sv,mg)
SV* sv;
MAGIC* mg;
{
+ dTHR;
TAINT_IF((mg->mg_len & 1) ||
(mg->mg_len & 2) && mg->mg_obj == sv); /* kludge */
return 0;
@@ -1706,6 +1717,11 @@ MAGIC* mg;
origargv[i] = Nullch;
}
break;
+#ifdef USE_THREADS
+ case '@':
+ sv_setsv(errsv, sv);
+ break;
+#endif /* USE_THREADS */
}
return 0;
}