Skip to content

Commit

Permalink
do not dump_node if parser failed
Browse files Browse the repository at this point in the history
  • Loading branch information
matz committed Nov 11, 2016
1 parent 185dad3 commit 752ca51
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion mrbgems/mruby-compiler/core/parse.y
Original file line number Diff line number Diff line change
Expand Up @@ -5479,7 +5479,10 @@ mrb_parser_parse(parser_state *p, mrbc_context *c)
p->lex_strterm = NULL;

parser_init_cxt(p, c);
yyparse(p);
if (yyparse(p) != 0 || p->nerr > 0) {
p->tree = 0;
return;
}
if (!p->tree) {
p->tree = new_nil(p);
}
Expand Down

0 comments on commit 752ca51

Please sign in to comment.