Don't segfault when build_builtin_function detects an error.

This commit is contained in:
Bill Currie 2011-01-08 23:35:46 +09:00
parent 806d9110a2
commit c69ac1f56f
2 changed files with 8 additions and 4 deletions

View file

@ -535,8 +535,10 @@ builtin_function
def_t *def = $<def>-1;
if (!def->external) {
$$ = build_builtin_function (def, $<expr>0);
build_scope ($$, $$->def, current_params);
flush_scope ($$->scope, 1);
if ($$) {
build_scope ($$, $$->def, current_params);
flush_scope ($$->scope, 1);
}
}
}
;

View file

@ -252,8 +252,10 @@ subprogram_declaration
| subprogram_head ASSIGNOP '#' const ';'
{
$$ = build_builtin_function ($1, $4);
build_scope ($$, $$->def, current_params);
flush_scope ($$->scope, 1);
if ($$) {
build_scope ($$, $$->def, current_params);
flush_scope ($$->scope, 1);
}
}
;