X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=t%2FSub-Op-LexicalSub%2FLexicalSub.xs;h=a60fa20044543763071f453e405460a38f0e588d;hb=32384f24279ef75bc0b95279c093cf90d8c47195;hp=c2b7002d11ac6dd00964461bc7b5d1bb4c302bc7;hpb=c987524f0641ca6a25d5e3072c9d1a2ecef2f57c;p=perl%2Fmodules%2FSub-Op.git diff --git a/t/Sub-Op-LexicalSub/LexicalSub.xs b/t/Sub-Op-LexicalSub/LexicalSub.xs index c2b7002..a60fa20 100644 --- a/t/Sub-Op-LexicalSub/LexicalSub.xs +++ b/t/Sub-Op-LexicalSub/LexicalSub.xs @@ -63,11 +63,14 @@ PPCODE: cb = SvRV(cb); if (SvTYPE(cb) >= SVt_PVCV) { sub_op_init(&c); - 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); + 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);