diff options
author | Zefram <zefram@fysh.org> | 2011-11-19 16:00:32 +0000 |
---|---|---|
committer | Zefram <zefram@fysh.org> | 2011-11-19 16:05:57 +0000 |
commit | 676a678ac0683a727a07d56ed1a6e1fb59085d5a (patch) | |
tree | 949be32a9c809bdc0c50b6e1d7d35a8fe371bd59 /dump.c | |
parent | fde67290e2c173e19d166b4f9a9514f6f16dbb75 (diff) | |
download | perl-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.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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) |