don't segfault on blead [#83439]
Lukas Mai [Sat, 2 Mar 2013 20:56:18 +0000 (21:56 +0100)]
Turns out newATTRSUB can return NULL for subs with parse errors since
commit 9ffcdca1f504cb09088413c074b35af4b7f247e3. Handle that case.

Parameters.xs

index 64099fc..e5bbfba 100644 (file)
@@ -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);