summaryrefslogtreecommitdiff
path: root/pp_ctl.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2012-06-04 20:36:39 -0700
committerFather Chrysostomos <sprout@cpan.org>2012-06-04 20:36:39 -0700
commitd0279c7ce493b7237b2f252043db1926615bc800 (patch)
tree3fde630a0a1a4ef8a8e9693544e23d13773a0269 /pp_ctl.c
parentc947b31cf1422f59c2ed95f6d3de272c2793a60c (diff)
downloadperl-d0279c7ce493b7237b2f252043db1926615bc800.tar.gz
Fix bad assertions in pp_ctl.c:pp_caller
If a stash is freed or undefined by code that it calls, then pp_caller can encounter a freed stash or nameless stash. HvNAME_HEK returns null for a freed scalar and for a hash without a name. So CopSTASHPV will also be null in that case, which is expected. If the hash is undefined, it may not be SvOOK any more, and if it is freed it defi- nitely won’t be. The following code *does* assume, however that CopSTASH is non-null, so assert that.
Diffstat (limited to 'pp_ctl.c')
-rw-r--r--pp_ctl.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/pp_ctl.c b/pp_ctl.c
index 2ccd8127a8..b2ab8a5235 100644
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -1891,8 +1891,7 @@ PP(pp_caller)
}
DEBUG_CX("CALLER");
- assert(CopSTASHPV(cx->blk_oldcop));
- assert(SvOOK((HV*)CopSTASH(cx->blk_oldcop)));
+ assert(CopSTASH(cx->blk_oldcop));
stash_hek = HvNAME_HEK((HV*)CopSTASH(cx->blk_oldcop));
if (GIMME != G_ARRAY) {
EXTEND(SP, 1);