Merge pull request #1624 from cubicdaiya/issues/invalid_return_in_top_level

return-value of mrb_run is invalid in top-level-scope
This commit is contained in:
Yukihiro "Matz" Matsumoto
2013-12-30 21:10:30 -08:00
+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));
}