In cv_clone, use pad ID to identify mysub outside
authorFather Chrysostomos <sprout@cpan.org>
Tue, 4 Sep 2012 17:24:57 +0000 (10:24 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Sun, 16 Sep 2012 05:45:07 +0000 (22:45 -0700)
commit9ccc915ef51db520896c2ca075446d61eaef1870
tree0548a7d500e95a2d38466bc86a6c134bf1515850
parent1f122f9b83a0a767aa3a264b32482be38722715d
In cv_clone, use pad ID to identify mysub outside

This code prints ARRAY(0x802e10), whereas it should print
SCALAR(0xfedbee):

undef &bar;
eval 'sub bar { my @x }';
{
  my sub foo;
  foo();
  sub bar {
    CORE::state $x;
    sub foo { warn \$x }
  }
}

The foo sub has a strong CvOUTSIDE pointer, but what it points to
can still be undefined and redefined.  So we need to identify it
by its pad.
pad.c
t/cmd/lexsub.t