From: Lukas Mai Date: Sat, 2 Mar 2013 20:56:18 +0000 (+0100) Subject: don't segfault on blead [#83439] X-Git-Tag: v1.0101_01~4 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=2c1cb7bd2a76e09d6b6ebf18c5962f5d6722e49c;p=p5sagit%2FFunction-Parameters.git don't segfault on blead [#83439] Turns out newATTRSUB can return NULL for subs with parse errors since commit 9ffcdca1f504cb09088413c074b35af4b7f247e3. Handle that case. --- diff --git a/Parameters.xs b/Parameters.xs index 64099fc..e5bbfba 100644 --- a/Parameters.xs +++ b/Parameters.xs @@ -1956,7 +1956,9 @@ static int parse_fun(pTHX_ Sentinel sen, OP **pop, const char *keyword_ptr, STRL body ); - register_info(aTHX_ PTR2UV(CvROOT(cv)), declarator, spec, param_spec); + if (cv) { + register_info(aTHX_ PTR2UV(CvROOT(cv)), declarator, spec, param_spec); + } if (saw_name) { *pop = newOP(OP_NULL, 0);