The CvHASEVAL flag lets cv_clone know that the clone needs to have its
CvOUTSIDE pointer set, for the sake of string evals’ being able to
look up variables.
It was only being set on anonymous subs. It should be set for all
clonable subs. It doesn’t actually hurt to set it on all types of
subs, whether clonable or not, since it has no effect on non-clon-
able subs.
DEBUG_Xv(PerlIO_printf(Perl_debug_log,
"Pad clone on cv=0x%"UVxf"\n", PTR2UV(cv)));
CvCLONE_on(cv);
- CvHASEVAL_on(cv);
}
+ CvHASEVAL_on(cv);
}
}
my sub s3 { eval '$x' }
s3;
}
- local $::TODO = 'closure problem?';
is s2, 3, 'my sub inside predeclared my sub';
}