summaryrefslogtreecommitdiff
path: root/pp_ctl.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2013-06-08 00:11:23 -0700
committerFather Chrysostomos <sprout@cpan.org>2013-06-08 00:14:12 -0700
commitcb1ad50e615d49477a97593b9e0569e7167a258e (patch)
tree365f091a08591bfa2a6b9331aeb60e9dee3a1879 /pp_ctl.c
parentdcdfe746ecfff81cc2793db4e7fdfe25be590e0b (diff)
downloadperl-cb1ad50e615d49477a97593b9e0569e7167a258e.tar.gz
[perl #117941] eval crashes when current stash is freed
Diffstat (limited to 'pp_ctl.c')
-rw-r--r--pp_ctl.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/pp_ctl.c b/pp_ctl.c
index b3e813eef8..7a2ba07dc4 100644
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -3402,7 +3402,9 @@ S_doeval(pTHX_ int gimme, CV* outside, U32 seq, HV *hh)
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);