diff options
author | Father Chrysostomos <sprout@cpan.org> | 2013-06-08 00:23:02 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2013-06-08 00:23:02 -0700 |
commit | e39b51c67c54580003211fdb07a0c0f50113c6d1 (patch) | |
tree | 1a50cbef13323637ee363424fcdcf735367c029f | |
parent | 434f489be7a3ec92b6d20b3474a9eee71a87e2a1 (diff) | |
download | perl-e39b51c67c54580003211fdb07a0c0f50113c6d1.tar.gz |
[perl #117941] reset crashes when current stash is freed
-rw-r--r-- | sv.c | 2 | ||||
-rw-r--r-- | t/op/reset.t | 6 |
2 files changed, 6 insertions, 2 deletions
@@ -8982,7 +8982,7 @@ Perl_sv_resetpvn(pTHX_ const char *s, STRLEN len, HV * const stash) char todo[PERL_UCHAR_MAX+1]; const char *send; - if (!stash) + if (!stash || SvTYPE(stash) != SVt_PVHV) return; if (!s) { /* reset ?? searches */ diff --git a/t/op/reset.t b/t/op/reset.t index 291bc393ad..5c3b1622b0 100644 --- a/t/op/reset.t +++ b/t/op/reset.t @@ -7,7 +7,7 @@ BEGIN { } use strict; -plan tests => 30; +plan tests => 31; package aiieee; @@ -120,6 +120,10 @@ fresh_perl_is( # it crashes more reliably with a smaller script "ok\n", {}, "no crash if package is effectively renamed before op is freed"); +sub _117941 { package _117941; reset } +delete $::{"_117941::"}; +_117941(); +pass("no crash when current package is freed"); undef $/; my $prog = <DATA>; |