mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
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:
+1
-1
@@ -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));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user