diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2013-01-30 06:37:45 -0800 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2013-01-30 06:37:45 -0800 |
| commit | 184a721ae643bc1140997f2691378423bf046487 (patch) | |
| tree | 382176701051f857d13cdaa3dca53f15adacb340 /src | |
| parent | 7c813a9e15cb64cdaa6c8c47c84839357d6badcd (diff) | |
| parent | 8ce1ea843738170d53cf627b7b7ff09e55076b85 (diff) | |
| download | mruby-184a721ae643bc1140997f2691378423bf046487.tar.gz mruby-184a721ae643bc1140997f2691378423bf046487.zip | |
Merge pull request #803 from masamitsu-murase/protect_irep_of_ensure
Protect proc of ensure.
Diffstat (limited to 'src')
| -rw-r--r-- | src/vm.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -1236,6 +1236,12 @@ mrb_run(mrb_state *mrb, struct RProc *proc, mrb_value self) acc = ci->acc; pc = ci->pc; regs = mrb->stack = mrb->stbase + ci->stackidx; + { + int idx = eidx; + while (idx > mrb->ci->eidx) { + mrb_gc_protect(mrb, mrb_obj_value(mrb->ensure[--idx])); + } + } while (eidx > mrb->ci->eidx) { ecall(mrb, --eidx); } |
