Skip to content

Commit

Permalink
return-value of mrb_run is invalid in top-level-scope
Browse files Browse the repository at this point in the history
The return-value of mrb_run in top-level-scope
should be the evaluated value at last.
  • Loading branch information
cubicdaiya committed Dec 27, 2013
1 parent 14bff24 commit 325c3bc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/codegen.c
Expand Up @@ -661,7 +661,7 @@ scope_body(codegen_scope *s, node *tree, int val)
{
codegen_scope *scope = scope_new(s->mrb, s, tree->car);

codegen(scope, tree->cdr, val);
codegen(scope, tree->cdr, VAL);
if (!s->iseq) {
genop(scope, MKOP_A(OP_STOP, 0));
}
Expand Down

0 comments on commit 325c3bc

Please sign in to comment.