summaryrefslogtreecommitdiff
path: root/op.c
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>2000-01-23 20:43:56 +0000
committerGurusamy Sarathy <gsar@cpan.org>2000-01-23 20:43:56 +0000
commitef8040b067557994d471dfa4e5ac3900907e94ce (patch)
tree011d66a2dc6f9391e26171ba94e4d3b2f085a0db /op.c
parentb90e71be9e76b821dd24be6197b27d74c1fba439 (diff)
downloadperl-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.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/op.c b/op.c
index 529506b90e..29f860c8a8 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;