summaryrefslogtreecommitdiff
path: root/embed.fnc
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2012-06-29 00:50:30 -0700
committerFather Chrysostomos <sprout@cpan.org>2012-06-29 00:51:10 -0700
commit70794f7b4fe6d2c8f69493d55274dba5e4a20f91 (patch)
treeca7d8a3686283b1c5bcf9ca926c631da1782fd59 /embed.fnc
parent5dff782da0fedb2c813f8a63e1a8df588bb6159e (diff)
downloadperl-70794f7b4fe6d2c8f69493d55274dba5e4a20f91.tar.gz
Make formats close over the right closure
This was brought up in ticket #113812. Formats that are nested inside closures only work if invoked from directly inside that closure. Calling the format from an inner sub call won’t work. Commit af41786fe57 stopped it from crashing, making it work as well as 5.8, in that closed-over variables would be undefined, being unavailable. This commit adds a variation of the find_runcv function that can check whether CvROOT matches an argument passed in. So we look not for the current sub, but for the topmost sub on the call stack that is a clone of the closure prototype that the format’s CvOUTSIDE field points to.
Diffstat (limited to 'embed.fnc')
-rw-r--r--embed.fnc2
1 files changed, 2 insertions, 0 deletions
diff --git a/embed.fnc b/embed.fnc
index b79341b897..c16dde8108 100644
--- a/embed.fnc
+++ b/embed.fnc
@@ -2327,6 +2327,8 @@ pdR |AV* |padlist_dup |NULLOK AV *srcpad|NN CLONE_PARAMS *param
#endif
ApdR |CV* |find_runcv |NULLOK U32 *db_seqp
+pR |CV* |find_runcv_where|U8 cond|NULLOK void *arg \
+ |NULLOK U32 *db_seqp
: Only used in perl.c
p |void |free_tied_hv_pool
#if defined(DEBUGGING)