/* This ensures that warnings are reported at the first
line of a redefinition, not the last. */
CopLINE_set(PL_curcop, PL_parser->copline);
+ /* protect against fatal warnings leaking compcv */
+ SAVEFREESV(PL_compcv);
report_redefined_cv(namesv, cv, const_svp);
+ SvREFCNT_inc_simple_void_NN(PL_compcv);
CopLINE_set(PL_curcop, oldline);
}
#ifdef PERL_MAD
eleak(2, 0, "no warnings; use feature ':all'; $f 'misc';
my sub foo{} sub foo:lvalue",
'ignored mysub :lvalue with fatal warnings');
-$::TODO = 'still leaks';
eleak(2, 0, "no warnings; use feature ':all'; $all
my sub foo{} sub foo:lvalue{}",
'fatal mysub redef warning');
eleak(2, 0, "$all sub foo{} sub foo{}", 'fatal sub redef warning');
+$::TODO = 'still leaks';
eleak(2, 0, "$all *x=sub {}",
'fatal sub redef warning with sub-to-glob assignment');
eleak(2, 0, "$all *x=sub() {1}",