X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=op.c;h=db2a67bba740ec658b896944f3005bc9ea6670e2;hb=20e8a3a35e61c7fcc6a4173969d7b685e762aef7;hp=71ee84855908434ef2696e076eec826d6e43af9f;hpb=553e7bb0c885d7b666ab73f45e41f7e6dab46330;p=p5sagit%2Fp5-mst-13.2.git diff --git a/op.c b/op.c index 71ee848..db2a67b 100644 --- a/op.c +++ b/op.c @@ -2428,6 +2428,7 @@ Perl_fold_constants(pTHX_ register OP *o) OP *old_next; SV * const oldwarnhook = PL_warnhook; SV * const olddiehook = PL_diehook; + COP not_compiling; dJMPENV; PERL_ARGS_ASSERT_FOLD_CONSTANTS; @@ -2492,6 +2493,13 @@ Perl_fold_constants(pTHX_ register OP *o) oldscope = PL_scopestack_ix; create_eval_scope(G_FAKINGEVAL); + /* Verify that we don't need to save it: */ + assert(PL_curcop == &PL_compiling); + StructCopy(&PL_compiling, ¬_compiling, COP); + PL_curcop = ¬_compiling; + /* The above ensures that we run with all the correct hints of the + currently compiling COP, but that IN_PERL_RUNTIME is not true. */ + assert(IN_PERL_RUNTIME); PL_warnhook = PERL_WARNHOOK_FATAL; PL_diehook = NULL; JMPENV_PUSH(ret); @@ -2525,6 +2533,7 @@ Perl_fold_constants(pTHX_ register OP *o) JMPENV_POP; PL_warnhook = oldwarnhook; PL_diehook = olddiehook; + PL_curcop = &PL_compiling; if (PL_scopestack_ix > oldscope) delete_eval_scope(); @@ -4326,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;