if (SvTYPE(proto) == SVt_PVCV)
{
outside = find_runcv(NULL);
- if (!CvANON(proto) && CvROOT(outside) != CvROOT(CvOUTSIDE(proto)))
- outside = CvOUTSIDE(proto);
+ if (!CvANON(proto)) {
+ if (!CvPADLIST(outside) ||
+ CvPADLIST(outside)->xpadl_id != protopadlist->xpadl_outid)
+ outside = CvOUTSIDE(proto);
+ if (!CvPADLIST(outside) ||
+ CvPADLIST(outside)->xpadl_id != protopadlist->xpadl_outid)
+ outside = NULL;
+ }
}
else {
outside = CvOUTSIDE(proto);
depth = outside ? CvDEPTH(outside) : 0;
if (!depth)
depth = 1;
- assert(SvTYPE(proto) == SVt_PVFM || CvPADLIST(outside));
ENTER;
SAVESPTR(PL_compcv);
outpad = outside && CvPADLIST(outside)
? AvARRAY(PadlistARRAY(CvPADLIST(outside))[depth])
: NULL;
- assert(outpad || SvTYPE(cv) == SVt_PVFM);
if (outpad) CvPADLIST(cv)->xpadl_outid = CvPADLIST(outside)->xpadl_id;
for (ix = fpad; ix > 0; ix--) {
*bar::like = *like;
}
no warnings 'deprecated';
-plan 112;
+plan 113;
# -------------------- our -------------------- #
sub not_lexical6 { sub foo { } }
pass 'no crash when cloning a mysub declared inside an undef pack sub';
}
+
+undef ¬_lexical7;
+eval 'sub not_lexical7 { my @x }';
+{
+ my sub foo;
+ foo();
+ sub not_lexical7 {
+ state $x;
+ sub foo {
+ is ref \$x, 'SCALAR',
+ "redeffing a mysub's outside does not make it use the wrong pad"
+ }
+ }
+}