]> git.vpit.fr Git - perl/modules/Scope-Upper.git/commitdiff
Inline Perl_cv_clone() and Perl_new_pad() rt71212
authorVincent Pit <vince@profvince.com>
Tue, 13 Sep 2011 10:42:15 +0000 (12:42 +0200)
committerVincent Pit <vince@profvince.com>
Tue, 13 Sep 2011 13:25:07 +0000 (15:25 +0200)
What we really need to fake the callback's GV is a pure copy of it, but
Perl_cv_clone does not do this : it creates a new copy with a depth of 1
and an empty pad, which is appropriate for pp_anoncode but not for our
situation. The easiest way to fix this is simply to inline Perl_cv_clone()
in our code, set up the copy's depth from the original, and crudely copy
the old pad into a new one.

This fixes closures defined in the uplevel callback that captures lexical
from outside of the uplevel call, and also allows us to remove all the
hacks from the previous su_cv_clone().


No differences found