summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2012-09-20 11:53:49 -0500
committerJesse Luehrs <doy@tozt.net>2012-09-20 11:53:49 -0500
commit5fd2d16154bc75b2174e9936999058daee900e3a (patch)
treeaa37c7b41ca4c3c01789220719c58f39390cac90
parentd014c200afc692c5aebacd8afa78150e3246afa7 (diff)
downloadfun-5fd2d16154bc75b2174e9936999058daee900e3a.tar.gz
fun-5fd2d16154bc75b2174e9936999058daee900e3a.zip
don't compile named functions as anon
-rw-r--r--Fun.xs5
1 files changed, 4 insertions, 1 deletions
diff --git a/Fun.xs b/Fun.xs
index 061e43d..8cb7d2a 100644
--- a/Fun.xs
+++ b/Fun.xs
@@ -244,10 +244,10 @@ static OP *parse_fun(pTHX_ GV *namegv, SV *psobj, U32 *flagsp)
CV *code;
OP *arg_assign = NULL, *block, *name;
- floor = start_subparse(0, CVf_ANON);
lex_read_space(0);
if (isIDFIRST(*(PL_parser->bufptr)) || *(PL_parser->bufptr) == ':') {
+ floor = start_subparse(0, 0);
function_name = sv_2mortal(newSVpvs(""));
while (isIDFIRST(*(PL_parser->bufptr)) || *(PL_parser->bufptr) == ':') {
if (lex_peek_unichar(0) == ':') {
@@ -260,6 +260,9 @@ static OP *parse_fun(pTHX_ GV *namegv, SV *psobj, U32 *flagsp)
}
}
}
+ else {
+ floor = start_subparse(0, CVf_ANON);
+ }
lex_read_space(0);
if (lex_peek_unichar(0) == '(') {