This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Merge latest mainline
authorNick Ing-Simmons <nik@tiuk.ti.com>
Sat, 18 Jul 1998 20:50:26 +0000 (20:50 +0000)
committerNick Ing-Simmons <nik@tiuk.ti.com>
Sat, 18 Jul 1998 20:50:26 +0000 (20:50 +0000)
p4raw-id: //depot/ansiperl@1536

ext/Thread/Thread.xs
op.h
patchlevel.h
util.c

index 30ccaf4..f61a927 100644 (file)
@@ -150,21 +150,31 @@ threadstart(void *arg)
     SvREFCNT_dec(thr->errsv);
     SvREFCNT_dec(thr->errhv);
 
-    Safefree(PL_markstack);
-    Safefree(PL_scopestack);
-    Safefree(PL_savestack);
-    Safefree(PL_retstack);
-    Safefree(cxstack);
-    Safefree(PL_tmps_stack);
-    Safefree(PL_ofs);
-
-    SvREFCNT_dec(PL_rs);
-    SvREFCNT_dec(PL_nrs);
-    SvREFCNT_dec(PL_statname);
-    Safefree(PL_screamfirst);
-    Safefree(PL_screamnext);
-    Safefree(PL_reg_start_tmp);
-    SvREFCNT_dec(PL_lastscream);
+    /*Safefree(cxstack);*/
+    while (curstackinfo->si_next)
+       curstackinfo = curstackinfo->si_next;
+    while (curstackinfo) {
+       PERL_SI *p = curstackinfo->si_prev;
+       SvREFCNT_dec(curstackinfo->si_stack);
+       Safefree(curstackinfo->si_cxstack);
+       Safefree(curstackinfo);
+       curstackinfo = p;
+    }    
+    Safefree(markstack);
+    Safefree(scopestack);
+    Safefree(savestack);
+    Safefree(retstack);
+    Safefree(tmps_stack);
+    Safefree(ofs);
+
+    SvREFCNT_dec(rs);
+    SvREFCNT_dec(nrs);
+    SvREFCNT_dec(statname);
+    Safefree(screamfirst);
+    Safefree(screamnext);
+    Safefree(reg_start_tmp);
+    SvREFCNT_dec(lastscream);
+    /*SvREFCNT_dec(defoutgv);*/
 
     MUTEX_LOCK(&thr->mutex);
     DEBUG_L(PerlIO_printf(PerlIO_stderr(),
diff --git a/op.h b/op.h
index 0161110..75e674e 100644 (file)
--- a/op.h
+++ b/op.h
@@ -81,10 +81,14 @@ typedef U32 PADOFFSET;
                                /*  On OP_ENTERITER, loop var is per-thread */
 
 /* old names; don't use in new code, but don't break them, either */
-#define OPf_LIST       1
-#define OPf_KNOW       2
+#define OPf_LIST       OPf_WANT_LIST
+#define OPf_KNOW       OPf_WANT
 #define GIMME \
-         (PL_op->op_flags & OPf_KNOW ? PL_op->op_flags & OPf_LIST : dowantarray())
+         (PL_op->op_flags & OPf_WANT                                   \
+          ? ((PL_op->op_flags & OPf_WANT) == OPf_WANT_LIST             \
+             ? G_ARRAY                                                 \
+             : G_SCALAR)                                               \
+          : dowantarray())
 
 /* Private for lvalues */
 #define OPpLVAL_INTRO  128     /* Lvalue must be localized */
index e46a9f4..6c584bb 100644 (file)
@@ -40,6 +40,7 @@
 static char    *local_patches[] = {
        NULL
        ,"DEVEL_BETA_ISSUE_1 - 5.005 Public Beta, Issue 1"
+       ,"PL_ prefix on vars"
        ,NULL
 };
 
diff --git a/util.c b/util.c
index 9e54229..19487d3 100644 (file)
--- a/util.c
+++ b/util.c
@@ -2780,18 +2780,18 @@ new_struct_thread(struct perl_thread *t)
     PL_in_eval = FALSE;
     PL_restartop = 0;
 
-    PL_tainted = t->Ttainted;
-    PL_curpm = t->Tcurpm;         /* XXX No PMOP ref count */
-    PL_nrs = newSVsv(t->Tnrs);
-    PL_rs = SvREFCNT_inc(PL_nrs);
-    PL_last_in_gv = (GV*)SvREFCNT_inc(t->Tlast_in_gv);
-    PL_ofslen = t->Tofslen;
-    PL_ofs = savepvn(t->Tofs, PL_ofslen);
-    PL_defoutgv = (GV*)SvREFCNT_inc(t->Tdefoutgv);
-    PL_chopset = t->Tchopset;
-    PL_formtarget = newSVsv(t->Tformtarget);
-    PL_bodytarget = newSVsv(t->Tbodytarget);
-    PL_toptarget = newSVsv(t->Ttoptarget);
+    tainted = t->Ttainted;
+    curpm = t->Tcurpm;         /* XXX No PMOP ref count */
+    nrs = newSVsv(t->Tnrs);
+    rs = SvREFCNT_inc(nrs);
+    last_in_gv = Nullgv;
+    ofslen = t->Tofslen;
+    ofs = savepvn(t->Tofs, ofslen);
+    defoutgv = (GV*)SvREFCNT_inc(t->Tdefoutgv);
+    chopset = t->Tchopset;
+    formtarget = newSVsv(t->Tformtarget);
+    bodytarget = newSVsv(t->Tbodytarget);
+    toptarget = newSVsv(t->Ttoptarget);
 
     PL_statname = NEWSV(66,0);
     PL_maxscream = -1;