X-Git-Url: https://perl5.git.perl.org/perl5.git/blobdiff_plain/885f468ab43f5574564ed6c3ba42b7e01191a66e..ae241e6332da384a53d2a0d1dbd0068bfd24f92a:/op.c diff --git a/op.c b/op.c index 7985fea..46b0522 100644 --- a/op.c +++ b/op.c @@ -2001,7 +2001,6 @@ Perl_op_lvalue_flags(pTHX_ OP *o, I32 type, U32 flags) else if (!(o->op_flags & OPf_KIDS)) break; if (o->op_targ != OP_LIST) { - case OP_SCALAR: op_lvalue(cBINOPo->op_first, type); break; } @@ -6150,6 +6149,7 @@ S_newGIVWHENOP(pTHX_ OP *cond, OP *block, /* This is a default {} block */ enterop->op_first = block; enterop->op_flags |= OPf_SPECIAL; + o ->op_flags |= OPf_SPECIAL; o->op_next = (OP *) enterop; } @@ -7468,6 +7468,7 @@ Perl_ck_eof(pTHX_ OP *o) PERL_ARGS_ASSERT_CK_EOF; if (o->op_flags & OPf_KIDS) { + OP *kid; if (cLISTOPo->op_first->op_type == OP_STUB) { OP * const newop = newUNOP(o->op_type, OPf_SPECIAL, newGVOP(OP_GV, 0, PL_argvgv)); @@ -7478,7 +7479,10 @@ Perl_ck_eof(pTHX_ OP *o) #endif o = newop; } - return ck_fun(o); + o = ck_fun(o); + kid = cLISTOPo->op_first; + if (kid->op_type == OP_RV2GV) + kid->op_private |= OPpALLOW_FAKE; } return o; } @@ -8281,7 +8285,11 @@ Perl_ck_readline(pTHX_ OP *o) { PERL_ARGS_ASSERT_CK_READLINE; - if (!(o->op_flags & OPf_KIDS)) { + if (o->op_flags & OPf_KIDS) { + OP *kid = cLISTOPo->op_first; + if (kid->op_type == OP_RV2GV) kid->op_private |= OPpALLOW_FAKE; + } + else { OP * const newop = newUNOP(OP_READLINE, 0, newGVOP(OP_GV, 0, PL_argvgv)); #ifdef PERL_MAD @@ -9686,6 +9694,19 @@ Perl_ck_substr(pTHX_ OP *o) } OP * +Perl_ck_tell(pTHX_ OP *o) +{ + PERL_ARGS_ASSERT_CK_TELL; + o = ck_fun(o); + if (o->op_flags & OPf_KIDS) { + OP *kid = cLISTOPo->op_first; + if (kid->op_type == OP_NULL && kid->op_sibling) kid = kid->op_sibling; + if (kid->op_type == OP_RV2GV) kid->op_private |= OPpALLOW_FAKE; + } + return o; +} + +OP * Perl_ck_each(pTHX_ OP *o) { dVAR;