Re: [PATCH] MAD fix p55 $[
authorGerard Goossen <gerard@tty.nl>
Mon, 10 Mar 2008 15:44:03 +0000 (16:44 +0100)
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>
Mon, 10 Mar 2008 21:34:23 +0000 (21:34 +0000)
Message-ID: <20080310144403.GC28994@ostwald>

p4raw-id: //depot/perl@33467

mad/t/p55.t
op.c

index 770f6c5..e1f3523 100644 (file)
@@ -64,10 +64,6 @@ use Test::Differences;
 our %failing = map { $_, 1 } qw|
 ../t/comp/require.t
 
-../t/op/array.t
-../t/op/local.t
-../t/op/substr.t
-
 ../t/comp/parser.t
 
 ../t/op/switch.t
@@ -172,10 +168,10 @@ eval { require 5.005 }
 sub PerlIO::F_UTF8 () { 0x00008000 } # from perliol.h
 BEGIN { PerlIO::Layer->find("encoding",1);}
 ########
-# TODO from ../t/op/array.t
+# from ../t/op/array.t
 $[ = 1
 ########
-# TODO from t/comp/parser.t
+# from t/comp/parser.t
 $x = 1 for ($[) = 0;
 ########
 # from t/op/getppid.t
diff --git a/op.c b/op.c
index 8ea3fd8..db2a67b 100644 (file)
--- a/op.c
+++ b/op.c
@@ -4335,10 +4335,11 @@ Perl_newASSIGNOP(pTHX_ I32 flags, OP *left, I32 optype, OP *right)
        if (PL_eval_start)
            PL_eval_start = 0;
        else {
-           /* FIXME for MAD */
-           op_free(o);
-           o = newSVOP(OP_CONST, 0, newSViv(CopARYBASE_get(&PL_compiling)));
-           o->op_private |= OPpCONST_ARYBASE;
+           if (!PL_madskills) { /* assignment to $[ is ignored when making a mad dump */
+               op_free(o);
+               o = newSVOP(OP_CONST, 0, newSViv(CopARYBASE_get(&PL_compiling)));
+               o->op_private |= OPpCONST_ARYBASE;
+           }
        }
     }
     return o;