mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
p->tree may be NULL; close #161
This commit is contained in:
+6
-4
@@ -4630,9 +4630,6 @@ mrb_parser_parse(parser_state *p)
|
|||||||
}
|
}
|
||||||
yyparse(p);
|
yyparse(p);
|
||||||
tree = p->tree;
|
tree = p->tree;
|
||||||
if ((int)tree->car == NODE_SCOPE) {
|
|
||||||
p->locals = cons(tree->cdr->car, 0);
|
|
||||||
}
|
|
||||||
if (!tree) {
|
if (!tree) {
|
||||||
if (p->begin_tree) {
|
if (p->begin_tree) {
|
||||||
tree = p->begin_tree;
|
tree = p->begin_tree;
|
||||||
@@ -4641,11 +4638,16 @@ mrb_parser_parse(parser_state *p)
|
|||||||
tree = new_nil(p);
|
tree = new_nil(p);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (p->begin_tree) {
|
else {
|
||||||
|
if ((int)tree->car == NODE_SCOPE) {
|
||||||
|
p->locals = cons(tree->cdr->car, 0);
|
||||||
|
}
|
||||||
|
if (p->begin_tree) {
|
||||||
tree = new_begin(p, p->begin_tree);
|
tree = new_begin(p, p->begin_tree);
|
||||||
append(tree, p->tree);
|
append(tree, p->tree);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
parser_state*
|
parser_state*
|
||||||
mrb_parser_new(mrb_state *mrb)
|
mrb_parser_new(mrb_state *mrb)
|
||||||
|
|||||||
Reference in New Issue
Block a user