diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2017-10-16 22:35:25 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2017-10-16 22:35:25 +0900 |
| commit | 1988bec23e4a0eb3dbabea19a02dd6cdb91158c3 (patch) | |
| tree | 72c73608048a6f01587e90f61e12395dc2f66929 /mrbgems/mruby-bin-mirb/tools | |
| parent | c3710dbb969948928f01c17a480e14a86b30fe5a (diff) | |
| download | mruby-1988bec23e4a0eb3dbabea19a02dd6cdb91158c3.tar.gz mruby-1988bec23e4a0eb3dbabea19a02dd6cdb91158c3.zip | |
Need to adjust the stack length of the top-level environment; fix #3819
Diffstat (limited to 'mrbgems/mruby-bin-mirb/tools')
| -rw-r--r-- | mrbgems/mruby-bin-mirb/tools/mirb/mirb.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/mrbgems/mruby-bin-mirb/tools/mirb/mirb.c b/mrbgems/mruby-bin-mirb/tools/mirb/mirb.c index fe311d830..891259a3f 100644 --- a/mrbgems/mruby-bin-mirb/tools/mirb/mirb.c +++ b/mrbgems/mruby-bin-mirb/tools/mirb/mirb.c @@ -544,6 +544,13 @@ done: if (args.verbose) { mrb_codedump_all(mrb, proc); } + /* adjest stack length of toplevel environment */ + if (mrb->c->cibase->env) { + struct REnv *e = mrb->c->cibase->env; + if (MRB_ENV_STACK_LEN(e) < proc->body.irep->nlocals) { + MRB_SET_ENV_STACK_LEN(e, proc->body.irep->nlocals); + } + } /* pass a proc for evaluation */ /* evaluate the bytecode */ result = mrb_vm_run(mrb, |
