X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=t%2FSub-Op-LexicalSub%2FLexicalSub.xs;h=a60fa20044543763071f453e405460a38f0e588d;hb=32384f24279ef75bc0b95279c093cf90d8c47195;hp=a4d2d8e6cc2ccbc19b56f70005434b4893cacabc;hpb=e87c30401d00a01f0b92de32fc9a71b25ad8b57f;p=perl%2Fmodules%2FSub-Op.git diff --git a/t/Sub-Op-LexicalSub/LexicalSub.xs b/t/Sub-Op-LexicalSub/LexicalSub.xs index a4d2d8e..a60fa20 100644 --- a/t/Sub-Op-LexicalSub/LexicalSub.xs +++ b/t/Sub-Op-LexicalSub/LexicalSub.xs @@ -62,11 +62,15 @@ PPCODE: if (SvROK(cb)) { cb = SvRV(cb); if (SvTYPE(cb) >= SVt_PVCV) { - c.name = SvPV_const(name, c.namelen); - c.check = sols_check; - c.ud = SvREFCNT_inc(cb); - c.pp = sols_pp; - sub_op_register(aTHX_ &c); + sub_op_init(&c); + c.name = SvPV_const(name, c.namelen); + if (SvPOK(cb)) { /* Sub is prototyped */ + c.proto = SvPV_const(cb, c.protolen); + } + c.check = sols_check; + c.ud = SvREFCNT_inc(cb); + c.pp = sols_pp; + sub_op_register(aTHX_ &c, 0); } } XSRETURN(0);