From: Gurusamy Sarathy Date: Sun, 23 Jan 2000 20:43:56 +0000 (+0000) Subject: optimize away runtime code for our($foo) (also avoid warnings) X-Git-Tag: perl-5.6.0~603 X-Git-Url: https://perl5.git.perl.org/perl5.git/commitdiff_plain/ef8040b067557994d471dfa4e5ac3900907e94ce optimize away runtime code for our($foo) (also avoid warnings) p4raw-id: //depot/perl@4866 --- diff --git a/op.c b/op.c index 529506b..29f860c 100644 --- a/op.c +++ b/op.c @@ -6292,7 +6292,15 @@ Perl_peep(pTHX_ register OP *o) case OP_GV: if (o->op_next->op_type == OP_RV2SV) { - if (!(o->op_next->op_private & OPpDEREF)) { + /* don't execute our($foo) */ + if (o->op_next->op_private & OPpOUR_INTRO) { + null(o->op_next); + o->op_next = o->op_next->op_next; + null(o); + if (oldop && o->op_next) + oldop->op_next = o->op_next; + } + else if (!(o->op_next->op_private & OPpDEREF)) { null(o->op_next); o->op_private |= o->op_next->op_private & OPpLVAL_INTRO; o->op_next = o->op_next->op_next;