return-value of mrb_run is invalid in top-level-scope

The return-value of mrb_run in top-level-scope
should be the evaluated value at last.
This commit is contained in:
cubicdaiya
2013-12-27 15:04:25 +09:00
parent 14bff248c3
commit 325c3bcfa4
+1 -1
View File
@@ -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));
}