summaryrefslogtreecommitdiff
path: root/pad.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2012-08-03 09:29:38 -0700
committerFather Chrysostomos <sprout@cpan.org>2012-09-15 22:45:04 -0700
commitfead5351141134064bc3069932e04930bd96eb0e (patch)
tree6cacadda5d3d17ea734dbb78ae19bb59aefcc27d /pad.c
parente10681aacd3d56adfffb2b63d491b36e8d3c3822 (diff)
downloadperl-fead5351141134064bc3069932e04930bd96eb0e.tar.gz
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.
Diffstat (limited to 'pad.c')
-rw-r--r--pad.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/pad.c b/pad.c
index 621849887e..d3200049f2 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);
}