Skip to content

Commit

Permalink
Add NULL pointer check before void_expr_error(); fix mruby#4192
Browse files Browse the repository at this point in the history
  • Loading branch information
ksekimoto committed Dec 21, 2018
1 parent ed9c520 commit 27acaa7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions mrbgems/mruby-compiler/core/parse.y
Original file line number Diff line number Diff line change
Expand Up @@ -3664,8 +3664,10 @@ void_expr_error(parser_state *p, node *n)
break;
case NODE_AND:
case NODE_OR:
void_expr_error(p, n->cdr->car);
void_expr_error(p, n->cdr->cdr);
if (n->cdr) {
void_expr_error(p, n->cdr->car);
void_expr_error(p, n->cdr->cdr);
}
break;
case NODE_BEGIN:
if (n->cdr) {
Expand Down

0 comments on commit 27acaa7

Please sign in to comment.