diff options
author | Nicholas Clark <nick@ccl4.org> | 2010-09-13 15:10:40 +0100 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2010-09-13 15:36:07 +0100 |
commit | 747350425d95672eb231bba3c24c254327448b4d (patch) | |
tree | ed39700b37df5f55258d492cfcc49363183850b5 /op.c | |
parent | 7d926cfad45d0fd1b9546391623278b92d3e4757 (diff) | |
download | perl-747350425d95672eb231bba3c24c254327448b4d.tar.gz |
In Perl_ck_subr(), consolidate all the prototype code in one if block.
This reveals that there is no need to set the variable prev when looping for
the !proto case.
Diffstat (limited to 'op.c')
-rw-r--r-- | op.c | 20 |
1 files changed, 10 insertions, 10 deletions
@@ -8464,7 +8464,6 @@ Perl_ck_subr(pTHX_ OP *o) list(o2); /* This is only called if !proto */ mod(o2, OP_ENTERSUB); - prev = o2; o2 = o2->op_sibling; } /* while */ } else { @@ -8647,16 +8646,17 @@ Perl_ck_subr(pTHX_ OP *o) prev = o2; o2 = o2->op_sibling; } /* while */ + + if (o2 == cvop && *proto == '_') { + /* generate an access to $_ */ + o2 = newDEFSVOP(); + o2->op_sibling = prev->op_sibling; + prev->op_sibling = o2; /* instead of cvop */ + } + if (!optional && proto_end > proto && + (*proto != '@' && *proto != '%' && *proto != ';' && *proto != '_')) + return too_few_arguments(o, gv_ename(namegv)); } - if (o2 == cvop && proto && *proto == '_') { - /* generate an access to $_ */ - o2 = newDEFSVOP(); - o2->op_sibling = prev->op_sibling; - prev->op_sibling = o2; /* instead of cvop */ - } - if (proto && !optional && proto_end > proto && - (*proto != '@' && *proto != '%' && *proto != ';' && *proto != '_')) - return too_few_arguments(o, gv_ename(namegv)); if(delete_op) { #ifdef PERL_MAD OP * const oldo = o; |