diff options
author | Father Chrysostomos <sprout@cpan.org> | 2012-06-29 00:50:30 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2012-06-29 00:51:10 -0700 |
commit | 70794f7b4fe6d2c8f69493d55274dba5e4a20f91 (patch) | |
tree | ca7d8a3686283b1c5bcf9ca926c631da1782fd59 /embed.h | |
parent | 5dff782da0fedb2c813f8a63e1a8df588bb6159e (diff) | |
download | perl-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.h')
-rw-r--r-- | embed.h | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -1077,6 +1077,7 @@ #define dump_packsubs_perl(a,b) Perl_dump_packsubs_perl(aTHX_ a,b) #define dump_sub_perl(a,b) Perl_dump_sub_perl(aTHX_ a,b) #define finalize_optree(a) Perl_finalize_optree(aTHX_ a) +#define find_runcv_where(a,b,c) Perl_find_runcv_where(aTHX_ a,b,c) #define find_rundefsv2(a,b) Perl_find_rundefsv2(aTHX_ a,b) #define find_script(a,b,c,d) Perl_find_script(aTHX_ a,b,c,d) #define free_tied_hv_pool() Perl_free_tied_hv_pool(aTHX) |