Add assertions that pp_padav and pp_padhv push scalars of the correct type.
Gerard Goossen [Tue, 24 Nov 2009 10:27:04 +0000 (11:27 +0100)]
pp.c

diff --git a/pp.c b/pp.c
index b271e7b..292feb6 100644 (file)
--- a/pp.c
+++ b/pp.c
@@ -63,6 +63,7 @@ PP(pp_padav)
 {
     dVAR; dSP; dTARGET;
     I32 gimme;
+    assert(SvTYPE(TARG) == SVt_PVAV);
     if (PL_op->op_private & OPpLVAL_INTRO)
        if (!(PL_op->op_private & OPpPAD_STATE))
            SAVECLEARSV(PAD_SVl(PL_op->op_targ));
@@ -106,6 +107,7 @@ PP(pp_padhv)
     dVAR; dSP; dTARGET;
     I32 gimme;
 
+    assert(SvTYPE(TARG) == SVt_PVHV);
     XPUSHs(TARG);
     if (PL_op->op_private & OPpLVAL_INTRO)
        if (!(PL_op->op_private & OPpPAD_STATE))