diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 2000-01-23 20:43:56 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 2000-01-23 20:43:56 +0000 |
commit | ef8040b067557994d471dfa4e5ac3900907e94ce (patch) | |
tree | 011d66a2dc6f9391e26171ba94e4d3b2f085a0db /op.c | |
parent | b90e71be9e76b821dd24be6197b27d74c1fba439 (diff) | |
download | perl-ef8040b067557994d471dfa4e5ac3900907e94ce.tar.gz |
optimize away runtime code for our($foo) (also avoid warnings)
p4raw-id: //depot/perl@4866
Diffstat (limited to 'op.c')
-rw-r--r-- | op.c | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -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; |