diff options
author | Father Chrysostomos <sprout@cpan.org> | 2012-08-04 17:54:32 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2012-08-04 17:54:32 -0700 |
commit | f91073d438e1f6952add377836e416c47505261f (patch) | |
tree | f094e467ae98a680cbbfb1c9759ec571dd5555b7 /pad.c | |
parent | cae5dbbe30ba4a96ff5e570be0d90779f06fee71 (diff) | |
download | perl-f91073d438e1f6952add377836e416c47505261f.tar.gz |
pad.c:cv_clone: add assertions
The outer sub should always be active and have a pad if it is
a sub that is being cloned. Only formats can have an inactive or
padless outside. Add assertions to that effect.
Diffstat (limited to 'pad.c')
-rw-r--r-- | pad.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -2010,6 +2010,7 @@ Perl_cv_clone(pTHX_ CV *proto) outpad = CvPADLIST(outside) ? AvARRAY(AvARRAY(CvPADLIST(outside))[depth]) : NULL; + assert(outpad || SvTYPE(cv) == SVt_PVFM); for (ix = fpad; ix > 0; ix--) { SV* const namesv = (ix <= fname) ? pname[ix] : NULL; @@ -2022,6 +2023,7 @@ Perl_cv_clone(pTHX_ CV *proto) if (!outpad || !(sv = outpad[PARENT_PAD_INDEX(namesv)]) || ( SvPADSTALE(sv) && !SvPAD_STATE(namesv) && !CvDEPTH(outside)) ) { + assert(SvTYPE(cv) == SVt_PVFM); Perl_ck_warner(aTHX_ packWARN(WARN_CLOSURE), "Variable \"%"SVf"\" is not available", namesv); sv = NULL; |