summaryrefslogtreecommitdiff
path: root/op.c
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2001-06-06 01:33:31 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2001-06-06 01:33:31 +0000
commit2090ab20212398e485f20cd7e50303dcd3601be7 (patch)
tree968f397721d6fa6e8d901eb28b793a71bdabc288 /op.c
parent758e67a87e10a9deb9b76152119daf8ca2aa6267 (diff)
downloadperl-2090ab20212398e485f20cd7e50303dcd3601be7.tar.gz
Integrate change #10448 from maintperl; lexicals
outside an eval"" weren't resolved correctly inside a subroutine definition inside the eval"" if they were not already referenced in the toplevel of the eval""-ed code p4raw-link: @10448 on //depot/maint-5.6/perl: 332ba4f98bc63c81fd7ba0d06432a7f903d716cf p4raw-id: //depot/perl@10449 p4raw-integrated: from //depot/maint-5.6/perl@10447 'merge in' cop.h (@9288..) t/op/misc.t (@10394..) op.c pp_ctl.c (@10412..)
Diffstat (limited to 'op.c')
-rw-r--r--op.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/op.c b/op.c
index 34fb48a82d..18745183ef 100644
--- a/op.c
+++ b/op.c
@@ -346,15 +346,22 @@ S_pad_findlex(pTHX_ char *name, PADOFFSET newoff, U32 seq, CV* startcv,
switch (CxTYPE(cx)) {
default:
if (i == 0 && saweval) {
- seq = cxstack[saweval].blk_oldcop->cop_seq;
return pad_findlex(name, newoff, seq, PL_main_cv, -1, saweval, 0);
}
break;
case CXt_EVAL:
switch (cx->blk_eval.old_op_type) {
case OP_ENTEREVAL:
- if (CxREALEVAL(cx))
+ if (CxREALEVAL(cx)) {
+ PADOFFSET off;
saweval = i;
+ seq = cxstack[i].blk_oldcop->cop_seq;
+ startcv = cxstack[i].blk_eval.cv;
+ off = pad_findlex(name, newoff, seq, startcv, i-1,
+ saweval, 0);
+ if (off) /* continue looking if not found here */
+ return off;
+ }
break;
case OP_DOFILE:
case OP_REQUIRE:
@@ -371,7 +378,6 @@ S_pad_findlex(pTHX_ char *name, PADOFFSET newoff, U32 seq, CV* startcv,
saweval = i; /* so we know where we were called from */
continue;
}
- seq = cxstack[saweval].blk_oldcop->cop_seq;
return pad_findlex(name, newoff, seq, cv, i-1, saweval,FINDLEX_NOSEARCH);
}
}