diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/codedump.c | 5 | ||||
| -rw-r--r-- | src/vm.c | 17 |
2 files changed, 21 insertions, 1 deletions
diff --git a/src/codedump.c b/src/codedump.c index 542e54904..b0a7676f0 100644 --- a/src/codedump.c +++ b/src/codedump.c @@ -455,6 +455,11 @@ codedump(mrb_state *mrb, const mrb_irep *irep) printf("OP_INTERN\tR%d", a); print_lv_a(mrb, irep, a); break; + CASE(OP_SYMBOL, BB): + mrb_assert((irep->pool[b].tt&IREP_TT_NFLAG)==0); + printf("OP_SYMBOL\tR%d\tL(%d)\t; %s", a, b, irep->pool[b].u.str); + print_lv_a(mrb, irep, a); + break; CASE(OP_STRING, BB): if ((irep->pool[b].tt & IREP_TT_NFLAG) == 0) { printf("OP_STRING\tR%d\tL(%d)\t; %s", a, b, irep->pool[b].u.str); @@ -2630,7 +2630,22 @@ RETRY_TRY_BLOCK: mrb_sym sym = mrb_intern_str(mrb, regs[a]); regs[a] = mrb_symbol_value(sym); - mrb_gc_arena_restore(mrb, ai); + NEXT; + } + + CASE(OP_SYMBOL, BB) { + size_t len; + mrb_sym sym; + + mrb_assert((pool[b].tt&IREP_TT_NFLAG)==0); + len = pool[b].tt >> 2; + if (pool[b].tt & IREP_TT_SFLAG) { + sym = mrb_intern_static(mrb, pool[b].u.str, len); + } + else { + sym = mrb_intern(mrb, pool[b].u.str, len); + } + regs[a] = mrb_symbol_value(sym); NEXT; } |
