mrb_run to return last evaluated value

This commit is contained in:
Yukihiro Matsumoto
2012-05-10 18:20:49 +09:00
parent 8268f95e0e
commit 878593430a
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -523,7 +523,7 @@ scope_body(codegen_scope *s, node *tree)
int idx = scope->idx;
if (!s->iseq) {
codegen(scope, tree->cdr, NOVAL);
codegen(scope, tree->cdr, VAL);
genop(scope, MKOP_A(OP_STOP, 0));
}
else {
+1 -1
View File
@@ -1558,7 +1558,7 @@ mrb_run(mrb_state *mrb, struct RProc *proc, mrb_value self)
/* stop VM */
L_STOP:
mrb->jmp = prev_jmp;
return mrb_nil_value();
return regs[irep->nlocals];
}
CASE(OP_ERR) {