free TLS slot properly on Windows
[p5sagit/p5-mst-13.2.git] / op.c
diff --git a/op.c b/op.c
index f1fe50b..263f784 100644 (file)
--- a/op.c
+++ b/op.c
@@ -1983,11 +1983,14 @@ Perl_bind_match(pTHX_ I32 type, OP *left, OP *right)
              desc, sample, sample);
     }
 
-    if (right->op_type == OP_MATCH ||
+    if (!(right->op_flags & OPf_STACKED) &&
+       (right->op_type == OP_MATCH ||
        right->op_type == OP_SUBST ||
-       right->op_type == OP_TRANS) {
+       right->op_type == OP_TRANS)) {
        right->op_flags |= OPf_STACKED;
-       if (right->op_type != OP_MATCH)
+       if (right->op_type != OP_MATCH &&
+            ! (right->op_type == OP_TRANS &&
+               right->op_private & OPpTRANS_IDENTICAL))
            left = mod(left, right->op_type);
        if (right->op_type == OP_TRANS)
            o = newBINOP(OP_NULL, OPf_STACKED, scalar(left), right);
@@ -2684,7 +2687,9 @@ Perl_pmtrans(pTHX_ OP *o, OP *expr, OP *repl)
        if (!squash) {
                if (t == r ||
                    (tlen == rlen && memEQ((char *)t, (char *)r, tlen)))
+               {
                    o->op_private |= OPpTRANS_IDENTICAL;
+               }
        }
 
        while (t < tend || tfirst <= tlast) {
@@ -4467,7 +4472,7 @@ Perl_newATTRSUB(pTHX_ I32 floor, OP *o, OP *proto, OP *attrs, OP *block)
          * skipping the prototype check
          */
         if (exists || SvPOK(cv))
-            cv_ckproto(cv, gv, ps);
+           cv_ckproto(cv, gv, ps);
        /* already defined (or promised)? */
        if (exists || GvASSUMECV(gv)) {
            SV* const_sv;
@@ -5758,6 +5763,10 @@ Perl_ck_defined(pTHX_ OP *o)             /* 19990527 MJD */
     if ((o->op_flags & OPf_KIDS) && ckWARN(WARN_DEPRECATED)) {
        switch (cUNOPo->op_first->op_type) {
        case OP_RV2AV:
+           /* This is needed for
+              if (defined %stash::)
+              to work.   Do not break Tk.
+              */
            break;                      /* Globals via GV can be undef */ 
        case OP_PADAV:
        case OP_AASSIGN:                /* Is this a good idea? */
@@ -5767,6 +5776,10 @@ Perl_ck_defined(pTHX_ OP *o)             /* 19990527 MJD */
                        "\t(Maybe you should just omit the defined()?)\n");
        break;
        case OP_RV2HV:
+           /* This is needed for
+              if (defined %stash::)
+              to work.   Do not break Tk.
+              */
            break;                      /* Globals via GV can be undef */ 
        case OP_PADHV:
            Perl_warner(aTHX_ WARN_DEPRECATED,
@@ -6197,7 +6210,7 @@ Perl_ck_split(pTHX_ OP *o)
        cLISTOPo->op_last = kid; /* There was only one element previously */
     }
 
-    if (kid->op_type != OP_MATCH) {
+    if (kid->op_type != OP_MATCH || kid->op_flags & OPf_STACKED) {
        OP *sibl = kid->op_sibling;
        kid->op_sibling = 0;
        kid = pmruntime( newPMOP(OP_MATCH, OPf_SPECIAL), kid, Nullop);