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 /pp.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 'pp.h')
-rw-r--r-- | pp.h | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -526,6 +526,8 @@ True if this op will be the return value of an lvalue subroutine # define MAYBE_DEREF_GV(sv) MAYBE_DEREF_GV_flags(sv,SV_GMAGIC) # define MAYBE_DEREF_GV_nomg(sv) MAYBE_DEREF_GV_flags(sv,0) +# define FIND_RUNCV_root_eq 1 + #endif /* |