This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
related to [perl #113060] assert CopSTASH(cx->blk_oldcop)
authorReini Urban <rurban@x-ray.at>
Tue, 29 May 2012 21:06:00 +0000 (16:06 -0500)
committerFather Chrysostomos <sprout@cpan.org>
Tue, 29 May 2012 21:55:54 +0000 (14:55 -0700)
HvNAME_HEK((HV*)CopSTASH(cx->blk_oldcop)) does some implicit assumptions, which should
better be asserted. Also record CX pp_caller reads besides PUSH and POP.

pp_ctl.c

index 4e54bd3..34fe990 100644 (file)
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -1897,6 +1897,9 @@ PP(pp_caller)
        RETURN;
     }
 
+    DEBUG_CX("CALLER");
+    assert(CopSTASHPV(cx->blk_oldcop));
+    assert(SvOOK((HV*)CopSTASH(cx->blk_oldcop)));
     stash_hek = HvNAME_HEK((HV*)CopSTASH(cx->blk_oldcop));
     if (GIMME != G_ARRAY) {
         EXTEND(SP, 1);