Skip to content

Commit

Permalink
push value for NULL AST when value is required; fix #3110
Browse files Browse the repository at this point in the history
  • Loading branch information
matz committed Feb 17, 2016
1 parent ec35e54 commit d8fc09c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion mrbgems/mruby-compiler/core/codegen.c
Original file line number Diff line number Diff line change
Expand Up @@ -1179,7 +1179,13 @@ codegen(codegen_scope *s, node *tree, int val)
{
int nt;

if (!tree) return;
if (!tree) {
if (val) {
genop(s, MKOP_A(OP_LOADNIL, cursp()));
push();
}
return;
}

if (s->irep && s->filename_index != tree->filename_index) {
s->irep->filename = mrb_parser_get_filename(s->parser, s->filename_index);
Expand Down

0 comments on commit d8fc09c

Please sign in to comment.