(W io) The dirhandle you tried to close is either closed or not really
a dirhandle. Check your control flow.
+=item Closure prototype called
+
+(F) If a closure has attributes, the subroutine passed to an attribute
+handler is the prototype that is cloned when a new closure is created.
+This subroutine cannot be called.
+
=item Code missing after '/'
(F) You had a (sub-)template that ends with a '/'. There must be another
PP(pp_padsv)
{
dVAR; dSP; dTARGET;
+ if(!TARG) TARG = PAD_SVl(PL_op->op_targ) = newSV(0);
XPUSHs(TARG);
if (PL_op->op_flags & OPf_MOD) {
if (PL_op->op_private & OPpLVAL_INTRO)
SAVETMPS;
retry:
+ if (CvCLONE(cv) && ! CvCLONED(cv))
+ DIE(aTHX_ "Closure prototype called");
if (!CvROOT(cv) && !CvXSUB(cv)) {
GV* autogv;
SV* sub_name;
SAVECOMPPAD();
PAD_SET_CUR_NOSAVE(padlist, CvDEPTH(cv));
if (hasargs) {
- AV *const av = MUTABLE_AV(PAD_SVl(0));
+ AV *av = MUTABLE_AV(PAD_SVl(0));
+ if ((SV *)av == &PL_sv_undef)
+ PAD_SVl(0) = (SV *)(av = newAV());
if (AvREAL(av)) {
/* @_ is normally not REAL--this should only ever
* happen when DB::sub() calls things that modify @_ */
}
}
+# [perl #68560] Calling closure prototypes (only accessible via :attr)
+{
+ package brength;
+ my $proto;
+ sub MODIFY_CODE_ATTRIBUTES { $proto = $_[1]; _: }
+ {
+ my $x;
+ () = sub :a0 { $x };
+ }
+ package main;
+ eval { $proto->() }; # used to crash in pp_entersub
+ like $@, qr/^Closure prototype called/,
+ "Calling closure proto with (no) args";
+ eval { () = &$proto }; # used to crash in pp_leavesub
+ like $@, qr/^Closure prototype called/,
+ "Calling closure proto with no @_ that returns a lexical";
+}
+
done_testing();