From fead5351141134064bc3069932e04930bd96eb0e Mon Sep 17 00:00:00 2001 From: Father Chrysostomos Date: Fri, 3 Aug 2012 09:29:38 -0700 Subject: [PATCH] cv_clone: panic for no pad cv_clone has serendipitously gained the ability to clone CVs without pads. It is not clear that we want to add this ability to this API function, because we would be stuck supporting it, even if we came up with a better interface. It used to crash or fail an assertion if there was no pad. --- pad.c | 1 + 1 file changed, 1 insertion(+) diff --git a/pad.c b/pad.c index 6218498..d320004 100644 --- a/pad.c +++ b/pad.c @@ -2137,6 +2137,7 @@ Perl_cv_clone(pTHX_ CV *proto) { PERL_ARGS_ASSERT_CV_CLONE; + if (!CvPADLIST(proto)) Perl_croak(aTHX_ "panic: no pad in cv_clone"); return S_cv_clone(aTHX_ proto, NULL, NULL); } -- 2.7.4