On Tue Jan 23 21:46:58 2018, PEVANS wrote:
Show quoted text> With the new replacement of cv_clone() now in latest development
> commit, 5.16 looks exactly the same - still fails this test. I might
> have to deploy Devel::MAT at the moment $subD is created to inspect
> its pad and see what happened there.
As I suspected; `$captured` has captured the wrong thing. On t/10pad.t line 122 after $subD has been created, it already looks like:
[ 4/$captured]=SCALAR(PV) at 0x1e771c8 = "ABC"
...
[ 9/$subD ]=REF() at 0x1e77090 => CODE(PP,C) at 0x1e3e0b8
Show quoted text pmat> show 0x1e3e0b8
CODE(PP,C) at 0x1e3e0b8 with refcount 1
...
pad[0]=PAD(4) at 0x1e3e3e8
Show quoted text pmat> show 0x1e3e3e8
PAD(4) at 0x1e3e3e8 with refcount 1
...
[ 1/$captured]=NULL
So it appears that the 5.16 implementation of cv_clone() here that's called as part of the OP_REFGEN op in the optree to implement
my $subD = sub { ... };
has found the wrong `$captured` lexical. I wonder if we can patch this up somehow.
--
Paul Evans