summaryrefslogtreecommitdiff
path: root/op.c
diff options
context:
space:
mode:
authorDave Mitchell <davem@fdisolutions.com>2003-05-22 11:13:19 +0100
committerJarkko Hietaniemi <jhi@iki.fi>2003-05-24 06:42:52 +0000
commit241416b843acd61d654907e145e85fc482a50be6 (patch)
treec96cc76278637fbfae6930bd1167a874a602a6d8 /op.c
parentd1e22115d646ecce137e54c6ce8191dc91d252c4 (diff)
downloadperl-241416b843acd61d654907e145e85fc482a50be6.tar.gz
[PATCH #2] Re: [perl #22181] goto undefines my() variables
Date: Thu, 22 May 2003 10:13:19 +0100 Message-ID: <20030522091319.GA4568@fdgroup.com> Subject: Re: [PATCH #2] Re: [perl #22181] goto undefines my() variables From: Dave Mitchell <davem@fdgroup.com> Date: Fri, 23 May 2003 17:09:44 +0100 Message-ID: <20030523160944.GC9194@fdgroup.com> p4raw-id: //depot/perl@19610
Diffstat (limited to 'op.c')
-rw-r--r--op.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/op.c b/op.c
index f3e616f9a8..80a0e9b8c1 100644
--- a/op.c
+++ b/op.c
@@ -3618,11 +3618,6 @@ Perl_newWHILEOP(pTHX_ I32 flags, I32 debuggable, LOOP *loop, I32 whileline, OP *
if (!next)
next = unstack;
cont = append_elem(OP_LINESEQ, cont, unstack);
- if ((line_t)whileline != NOLINE) {
- PL_copline = (line_t)whileline;
- cont = append_elem(OP_LINESEQ, cont,
- newSTATEOP(0, Nullch, Nullop));
- }
}
listop = append_list(OP_LINESEQ, (LISTOP*)block, (LISTOP*)cont);
@@ -3675,13 +3670,16 @@ Perl_newFOROP(pTHX_ I32 flags,char *label,line_t forline,OP *sv,OP *expr,OP *blo
OP *wop;
PADOFFSET padoff = 0;
I32 iterflags = 0;
+ I32 iterpflags = 0;
if (sv) {
if (sv->op_type == OP_RV2SV) { /* symbol table variable */
+ iterpflags = sv->op_private & OPpOUR_INTRO; /* for our $x () */
sv->op_type = OP_RV2GV;
sv->op_ppaddr = PL_ppaddr[OP_RV2GV];
}
else if (sv->op_type == OP_PADSV) { /* private variable */
+ iterpflags = sv->op_private & OPpLVAL_INTRO; /* for my $x () */
padoff = sv->op_targ;
sv->op_targ = 0;
op_free(sv);
@@ -3740,6 +3738,9 @@ Perl_newFOROP(pTHX_ I32 flags,char *label,line_t forline,OP *sv,OP *expr,OP *blo
loop = (LOOP*)list(convert(OP_ENTERITER, iterflags,
append_elem(OP_LIST, expr, scalar(sv))));
assert(!loop->op_next);
+ /* for my $x () sets OPpLVAL_INTRO;
+ * for our $x () sets OPpOUR_INTRO; both only used by Deparse.pm */
+ loop->op_private = iterpflags;
#ifdef PL_OP_SLAB_ALLOC
{
LOOP *tmp;