Clear method caches when unwinding local *foo=*method
authorFather Chrysostomos <sprout@cpan.org>
Thu, 29 Nov 2012 02:04:01 +0000 (18:04 -0800)
committerFather Chrysostomos <sprout@cpan.org>
Thu, 29 Nov 2012 17:11:31 +0000 (09:11 -0800)
commit4e52a9b69e39f85d6a5d7ac598c61ff0b00f94ee
tree0ad7b7828f9733b88b28a3fed6799beb1492f4af
parent3d460042b1251a4b5e3b583fa6be358554dd3bcc
Clear method caches when unwinding local *foo=*method

It was already working for those cases where *foo contained a sub
before and after localisation.  For those cases where *foo had no sub
but localised assignment gave it one, method caches were not being
reset on scope exit.

case SAVEt_GP in scope.c:leave_scope needs to look at both GPs (glob
pointer, or list of glob slots), both from before and after the unlo-
calisation.  If either has a sub, method caches need to be cleared.

This does not yet fix local *foo = sub {}, but I added a to-do
test for it.  (This is more complicated, as localisation happens in
two seperate steps, the glob slot localisation storing no pointers to
the glob itself on the savestack.)
scope.c
t/mro/method_caching.t