parser_state->locals may be NULL on some error conditions; fix #2769

parent 6246483f
...@@ -274,7 +274,8 @@ local_add(parser_state *p, mrb_sym sym) ...@@ -274,7 +274,8 @@ local_add(parser_state *p, mrb_sym sym)
static node* static node*
new_scope(parser_state *p, node *body) new_scope(parser_state *p, node *body)
{ {
return cons((node*)NODE_SCOPE, cons(p->locals->car, body)); node *n = p->locals ? p->locals->car : NULL;
return cons((node*)NODE_SCOPE, cons(n, body));
} }
/* (:begin prog...) */ /* (:begin prog...) */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment