must copy changes from win32/makeifle.mk to wince/makefile.ce
[p5sagit/p5-mst-13.2.git] / op.c
diff --git a/op.c b/op.c
index b10eb81..04df4de 100644 (file)
--- a/op.c
+++ b/op.c
@@ -78,9 +78,9 @@ Perl_Slab_Free(pTHX_ void *op)
     assert( ptr < ( (I32 **) slab + PERL_SLAB_SIZE) );
     assert( *slab > 0 );
     if (--(*slab) == 0) {
-     #ifdef NETWARE
-      #define PerlMemShared PerlMem
-     #endif
+#  ifdef NETWARE
+#    define PerlMemShared PerlMem
+#  endif
        
     PerlMemShared_free(slab);
        if (slab == PL_OpSlab) {
@@ -3351,7 +3351,9 @@ S_new_logop(pTHX_ I32 type, I32 flags, OP** firstp, OP** otherp)
            return first;
        }
     }
-    else if (ckWARN(WARN_MISC) && (first->op_flags & OPf_KIDS)) {
+    else if (ckWARN(WARN_MISC) && (first->op_flags & OPf_KIDS) &&
+             type != OP_DOR) /* [#24076] Don't warn for <FH> err FOO. */
+    {
        OP *k1 = ((UNOP*)first)->op_first;
        OP *k2 = k1->op_sibling;
        OPCODE warnop = 0;
@@ -3779,7 +3781,9 @@ Perl_newLOOPEX(pTHX_ I32 type, OP *label)
        op_free(label);
     }
     else {
-       if (label->op_type == OP_ENTERSUB)
+       /* Check whether it's going to be a goto &function */
+       if (label->op_type == OP_ENTERSUB
+               && !(label->op_flags & OPf_STACKED))
            label = newUNOP(OP_REFGEN, 0, mod(label, OP_REFGEN));
        o = newUNOP(type, OPf_STACKED, label);
     }
@@ -4350,6 +4354,9 @@ Perl_newCONSTSUB(pTHX_ HV *stash, char *name, SV *sv)
     CvCONST_on(cv);
     sv_setpv((SV*)cv, "");  /* prototype is "" */
 
+    if (stash)
+       CopSTASH_free(PL_curcop);
+
     LEAVE;
 
     return cv;
@@ -6270,6 +6277,21 @@ Perl_peep(pTHX_ register OP *o)
            o->op_seq = PL_op_seqmax++;
            break;
        case OP_STUB:
+           /* XXX This makes sub {}; work as expected.
+              ie {return;} not {return @_;}
+              When optimiser is properly split into fixups and
+              optimisations, this needs to stay in the fixups.  */
+           if(!oldop &&
+              o->op_next &&
+              o->op_next->op_type == OP_LEAVESUB) {
+             OP* newop = newSTATEOP(0, Nullch, 0);
+              newop->op_next = o->op_next;
+              o->op_next = 0;
+                      op_free(o);
+              o = newop;
+                      ((UNOP*)o->op_next)->op_first = newop;   
+              CvSTART(PL_compcv) = newop;      
+           }
            if ((o->op_flags & OPf_WANT) != OPf_WANT_LIST) {
                o->op_seq = PL_op_seqmax++;
                break; /* Scalar stub must produce undef.  List stub is noop */