diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2017-12-04 10:08:06 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2017-12-04 10:15:12 +0900 |
| commit | 0b5d97ec4220c8a85eccfba427b6fb818a543b77 (patch) | |
| tree | 69ae7d1a03fd2c708849872a4d6378a9c153ba19 /src | |
| parent | 6f4d4bbcc7a510247db7f9c007c00aeb45b563f4 (diff) | |
| download | mruby-0b5d97ec4220c8a85eccfba427b6fb818a543b77.tar.gz mruby-0b5d97ec4220c8a85eccfba427b6fb818a543b77.zip | |
Need to unshare env stack on `break`; fix #3866
Diffstat (limited to 'src')
| -rw-r--r-- | src/vm.c | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -2043,7 +2043,9 @@ RETRY_TRY_BLOCK: proc = proc->upper; while (mrb->c->cibase < ci && ci[-1].proc != proc) { if (ci[-1].acc == CI_ACC_SKIP) { - mrb->c->ci = ci; + while (ci < mrb->c->ci) { + cipop(mrb); + } goto L_BREAK_ERROR; } ci--; @@ -2053,6 +2055,9 @@ RETRY_TRY_BLOCK: /* cannot happen */ break; } + while (ci < mrb->c->ci) { + cipop(mrb); + } while (mrb->c->eidx > ci->epos) { ecall_adjust(); } @@ -2062,10 +2067,6 @@ RETRY_TRY_BLOCK: mrb->jmp = prev_jmp; return v; } - while (ci < mrb->c->ci) { - mrb_env_unshare(mrb, mrb->c->ci->env); - mrb->c->ci--; - } acc = ci->acc; mrb->c->stack = ci->stackent; cipop(mrb); |
