if (CopSTASH_ne(PL_curcop, PL_curstash)) {
SAVEGENERICSV(PL_curstash);
- PL_curstash = (HV *)SvREFCNT_inc_simple(CopSTASH(PL_curcop));
+ PL_curstash = (HV *)CopSTASH(PL_curcop);
+ if (SvTYPE(PL_curstash) != SVt_PVHV) PL_curstash = NULL;
+ else SvREFCNT_inc_simple_void(PL_curstash);
}
/* XXX:ajgo do we really need to alloc an AV for begin/checkunit */
SAVESPTR(PL_beginav);
require './test.pl';
}
-plan(tests => 128);
+plan(tests => 129);
eval 'pass();';
EOE
qq'Right line number for eval "$_"';
}
+
+sub _117941 { package _117941; eval '$a' }
+delete $::{"_117941::"};
+_117941();
+pass("eval in freed package does not crash");