diff options
| author | Yukihiro Matsumoto <[email protected]> | 2012-07-27 10:05:47 +0900 |
|---|---|---|
| committer | Yukihiro Matsumoto <[email protected]> | 2012-07-27 10:05:47 +0900 |
| commit | 638a66fd7801624a47858d4e8e3927ca69a52f00 (patch) | |
| tree | 70ae884cd866b72f016da397024a528ea317959f /src | |
| parent | 92d37403f162c6876e60247114bc982d00d14aa2 (diff) | |
| download | mruby-638a66fd7801624a47858d4e8e3927ca69a52f00.tar.gz mruby-638a66fd7801624a47858d4e8e3927ca69a52f00.zip | |
adjust ci->nregs for C implemented methods
Diffstat (limited to 'src')
| -rw-r--r-- | src/gc.c | 2 | ||||
| -rw-r--r-- | src/vm.c | 4 |
2 files changed, 4 insertions, 2 deletions
@@ -545,6 +545,8 @@ obj_free(mrb_state *mrb, struct RBasic *obj) obj->tt = MRB_TT_FREE; } +#include <stdio.h> + static void root_scan_phase(mrb_state *mrb) { @@ -121,7 +121,6 @@ uvset(mrb_state *mrb, int up, int idx, mrb_value v) static mrb_callinfo* cipush(mrb_state *mrb) { - size_t nregs = mrb->ci->nregs; int eidx = mrb->ci->eidx; int ridx = mrb->ci->ridx; @@ -133,7 +132,7 @@ cipush(mrb_state *mrb) mrb->ciend = mrb->cibase + size * 2; } mrb->ci++; - mrb->ci->nregs = nregs; + mrb->ci->nregs = 0; mrb->ci->eidx = eidx; mrb->ci->ridx = ridx; mrb->ci->env = 0; @@ -719,6 +718,7 @@ mrb_run(mrb_state *mrb, struct RProc *proc, mrb_value self) mrb->stack += a; if (MRB_PROC_CFUNC_P(m)) { + ci->nregs = n + 1; mrb->stack[0] = m->body.func(mrb, recv); mrb->arena_idx = ai; if (mrb->exc) goto L_RAISE; |
