diff options
author | Father Chrysostomos <sprout@cpan.org> | 2012-06-04 20:36:39 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2012-06-04 20:36:39 -0700 |
commit | d0279c7ce493b7237b2f252043db1926615bc800 (patch) | |
tree | 3fde630a0a1a4ef8a8e9693544e23d13773a0269 /pp_ctl.c | |
parent | c947b31cf1422f59c2ed95f6d3de272c2793a60c (diff) | |
download | perl-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.c | 3 |
1 files changed, 1 insertions, 2 deletions
@@ -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); |