diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2017-02-27 16:17:57 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2017-02-27 16:17:57 +0900 |
| commit | 9e93d5dbf0c96cbf5cc0bc5a9c5f734248d7c37b (patch) | |
| tree | c48db701aa147678c83b0c6d88dec5d8fe495a3c | |
| parent | 736be0e98b9e1136a4dc7cb2dd05e1f33728f767 (diff) | |
| download | mruby-9e93d5dbf0c96cbf5cc0bc5a9c5f734248d7c37b.tar.gz mruby-9e93d5dbf0c96cbf5cc0bc5a9c5f734248d7c37b.zip | |
Stack may be reallocated in mrb_run(); fix #3465
| -rw-r--r-- | src/vm.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -289,7 +289,7 @@ ecall(mrb_state *mrb, int i) mrb_value *self = mrb->c->stack; struct RObject *exc; int cioff; - mrb_value *nstk; + ptrdiff_t nstk; if (i<0) return; p = mrb->c->ensure[i]; @@ -298,7 +298,7 @@ ecall(mrb_state *mrb, int i) mrb->c->ci->eidx = i; cioff = mrb->c->ci - mrb->c->cibase; ci = cipush(mrb); - nstk = ci->stackent; + nstk = ci->stackent - mrb->c->stbase; ci->stackent = mrb->c->stack; ci->mid = ci[-1].mid; ci->acc = CI_ACC_SKIP; @@ -310,7 +310,7 @@ ecall(mrb_state *mrb, int i) exc = mrb->exc; mrb->exc = 0; mrb_run(mrb, p, *self); mrb->c->ensure[i] = NULL; - ci->stackent = nstk; + ci->stackent = mrb->c->stbase + nstk; mrb->c->ci = mrb->c->cibase + cioff; if (!mrb->exc) mrb->exc = exc; } |
