From 5fd2d16154bc75b2174e9936999058daee900e3a Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Thu, 20 Sep 2012 11:53:49 -0500 Subject: don't compile named functions as anon --- Fun.xs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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) == '(') { -- cgit v1.2.3-54-g00ecf