Sync with the latest MakeMaker snapshot.
[p5sagit/p5-mst-13.2.git] / op.c
diff --git a/op.c b/op.c
index f08e6a3..020f463 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) {
@@ -1823,6 +1823,7 @@ Perl_newPROG(pTHX_ OP *o)
        if (o->op_type == OP_STUB) {
            PL_comppad_name = 0;
            PL_compcv = 0;
+           FreeOp(o);
            return;
        }
        PL_main_root = scope(sawparens(scalarvoid(o)));
@@ -4213,6 +4214,11 @@ Perl_newATTRSUB(pTHX_ I32 floor, OP *o, OP *proto, OP *attrs, OP *block)
                             mod(scalarseq(block), OP_LEAVESUBLV));
     }
     else {
+       /* This makes sub {}; work as expected.  */
+       if (block->op_type == OP_STUB) {
+           op_free(block);
+           block = newSTATEOP(0, Nullch, 0);
+       }
        CvROOT(cv) = newUNOP(OP_LEAVESUB, 0, scalarseq(block));
     }
     CvROOT(cv)->op_private |= OPpREFCOUNTED;
@@ -5230,8 +5236,7 @@ Perl_ck_fun(pTHX_ OP *o)
                                           
                                      }
                                      if (tmpstr) {
-                                          name = savepv(SvPVX(tmpstr));
-                                          len = strlen(name);
+                                          name = SvPV(tmpstr, len);
                                           sv_2mortal(tmpstr);
                                      }
                                 }
@@ -6259,23 +6264,6 @@ Perl_peep(pTHX_ register OP *o)
            o->op_seq = PL_op_seqmax++;
            break;
 
-       case OP_CONCAT:
-           if (o->op_next && o->op_next->op_type == OP_STRINGIFY) {
-               if (o->op_next->op_private & OPpTARGET_MY) {
-                   if (o->op_flags & OPf_STACKED) /* chained concats */
-                       goto ignore_optimization;
-                   else {
-                       /* assert(PL_opargs[o->op_type] & OA_TARGLEX); */
-                       o->op_targ = o->op_next->op_targ;
-                       o->op_next->op_targ = 0;
-                       o->op_private |= OPpTARGET_MY;
-                   }
-               }
-               op_null(o->op_next);
-           }
-         ignore_optimization:
-           o->op_seq = PL_op_seqmax++;
-           break;
        case OP_STUB:
            if ((o->op_flags & OPf_WANT) != OPf_WANT_LIST) {
                o->op_seq = PL_op_seqmax++;