summaryrefslogtreecommitdiff
path: root/dump.c
diff options
context:
space:
mode:
authorZefram <zefram@fysh.org>2011-11-19 16:00:32 +0000
committerZefram <zefram@fysh.org>2011-11-19 16:05:57 +0000
commit676a678ac0683a727a07d56ed1a6e1fb59085d5a (patch)
tree949be32a9c809bdc0c50b6e1d7d35a8fe371bd59 /dump.c
parentfde67290e2c173e19d166b4f9a9514f6f16dbb75 (diff)
downloadperl-676a678ac0683a727a07d56ed1a6e1fb59085d5a.tar.gz
narrower localisation of PL_compcv around eval
PL_compcv used to be localised around the entire string eval process, and hence at runtime of the evaled code would refer to the evaled code rather than code of a surrounding compilation. This interfered with the ability of string-evaled code in a BEGIN block to affect the surrounding compilation, in a similar way to the localisation of $^H and %^H that was fixed in f45b078d20. Similar to the fix there, this change moves the localisation of PL_compcv inside the new evalcomp scope. A couple of things were relying on PL_compcv to find the running code when in a string-eval scope; they now need to find it from cx->blk_eval.cv, which was already being populated.
Diffstat (limited to 'dump.c')
-rw-r--r--dump.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/dump.c b/dump.c
index d1803cd21c..3cb7167bb4 100644
--- a/dump.c
+++ b/dump.c
@@ -2195,7 +2195,7 @@ S_deb_curcv(pTHX_ const I32 ix)
if (CxTYPE(cx) == CXt_SUB || CxTYPE(cx) == CXt_FORMAT)
return cx->blk_sub.cv;
else if (CxTYPE(cx) == CXt_EVAL && !CxTRYBLOCK(cx))
- return PL_compcv;
+ return cx->blk_eval.cv;
else if (ix == 0 && PL_curstackinfo->si_type == PERLSI_MAIN)
return PL_main_cv;
else if (ix <= 0)