diff options
| author | Miura Hideki <[email protected]> | 2013-11-17 16:33:39 +0900 |
|---|---|---|
| committer | Miura Hideki <[email protected]> | 2013-11-19 20:38:02 +0900 |
| commit | 54c5b12fb7bc5fdd57326780e970ee467387f81a (patch) | |
| tree | cd4d15d20ef543b5ca20f3186ea49d50d4f52129 /src/vm.c | |
| parent | 2bda9652585616b49449904aad0195d8b23e58a4 (diff) | |
| download | mruby-54c5b12fb7bc5fdd57326780e970ee467387f81a.tar.gz mruby-54c5b12fb7bc5fdd57326780e970ee467387f81a.zip | |
irep->pool struct pool -> mrb_value
Diffstat (limited to 'src/vm.c')
| -rw-r--r-- | src/vm.c | 11 |
1 files changed, 4 insertions, 7 deletions
@@ -554,7 +554,7 @@ mrb_context_run(mrb_state *mrb, struct RProc *proc, mrb_value self, unsigned int /* mrb_assert(mrb_proc_cfunc_p(proc)) */ mrb_irep *irep = proc->body.irep; mrb_code *pc = irep->iseq; - struct irep_pool *pool = irep->pool; + mrb_value *pool = irep->pool; mrb_sym *syms = irep->syms; mrb_value *regs = NULL; mrb_code i; @@ -618,10 +618,7 @@ mrb_context_run(mrb_state *mrb, struct RProc *proc, mrb_value self, unsigned int CASE(OP_LOADL) { /* A Bx R(A) := Pool(Bx) */ - if (pool[GETARG_Bx(i)].type == IREP_TT_FLOAT) - SET_FLT_VALUE(mrb, regs[GETARG_A(i)], pool[GETARG_Bx(i)].value.f); - else - SET_INT_VALUE(regs[GETARG_A(i)], pool[GETARG_Bx(i)].value.i); + regs[GETARG_A(i)] = pool[GETARG_Bx(i)]; NEXT; } @@ -1939,7 +1936,7 @@ mrb_context_run(mrb_state *mrb, struct RProc *proc, mrb_value self, unsigned int CASE(OP_STRING) { /* A Bx R(A) := str_new(Lit(Bx)) */ - regs[GETARG_A(i)] = mrb_str_new(mrb, pool[GETARG_Bx(i)].value.s->buf, pool[GETARG_Bx(i)].value.s->len); + regs[GETARG_A(i)] = mrb_str_dup(mrb, pool[GETARG_Bx(i)]); mrb_gc_arena_restore(mrb, ai); NEXT; } @@ -2134,7 +2131,7 @@ mrb_context_run(mrb_state *mrb, struct RProc *proc, mrb_value self, unsigned int CASE(OP_ERR) { /* Bx raise RuntimeError with message Lit(Bx) */ - mrb_value msg = mrb_str_new(mrb, pool[GETARG_Bx(i)].value.s->buf, pool[GETARG_Bx(i)].value.s->len); + mrb_value msg = mrb_str_dup(mrb, pool[GETARG_Bx(i)]); mrb_value exc; if (GETARG_A(i) == 0) { |
