diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/array.c | 1 | ||||
| -rw-r--r-- | src/class.c | 2 | ||||
| -rw-r--r-- | src/dump.c | 5 | ||||
| -rw-r--r-- | src/proc.c | 1 | ||||
| -rw-r--r-- | src/vm.c | 2 |
5 files changed, 7 insertions, 4 deletions
diff --git a/src/array.c b/src/array.c index 4f2b5466c..f86743138 100644 --- a/src/array.c +++ b/src/array.c @@ -1315,6 +1315,7 @@ static const mrb_sym each_syms[] = { static const mrb_irep each_irep = { 3, /* nlocals */ 7, /* nregs */ + 0, /* clen */ MRB_ISEQ_NO_FREE | MRB_IREP_NO_FREE, /* flags */ each_iseq, /* iseq */ NULL, /* pool */ diff --git a/src/class.c b/src/class.c index 5ce32439a..0e443da90 100644 --- a/src/class.c +++ b/src/class.c @@ -2287,7 +2287,7 @@ static const mrb_code new_iseq[] = { const mrb_sym new_syms[] = { MRB_SYM(allocate), MRB_SYM(initialize) }; static const mrb_irep new_irep = { - 3, 6, MRB_IREP_STATIC, + 3, 6, 0, MRB_IREP_STATIC, new_iseq, NULL, new_syms, NULL, NULL, NULL, sizeof(new_iseq), 0, 2, 0, 0, }; diff --git a/src/dump.c b/src/dump.c index 884c44dc6..b14fc4a1f 100644 --- a/src/dump.c +++ b/src/dump.c @@ -291,6 +291,7 @@ write_catch_table_block(mrb_state *mrb, const mrb_irep *irep, uint8_t *buf) const struct mrb_irep_catch_hander *e = mrb_irep_catch_handler_table(irep); mrb_static_assert1(sizeof(*e) == 7); + if (e == NULL) return 0; /* irep->clen has already been written before iseq block */ memcpy(cur, (const void *)e, sizeof(*e) * irep->clen); cur += sizeof(*e) * irep->clen; @@ -1058,7 +1059,7 @@ dump_irep_struct(mrb_state *mrb, const mrb_irep *irep, uint8_t flags, FILE *fp, fputs("};\n", fp); } /* dump iseq */ - len=irep->ilen; + len=irep->ilen+sizeof(struct mrb_irep_catch_handler)*irep->clen; fprintf(fp, "static const mrb_code %s_iseq_%d[%d] = {", name, n, len); for (i=0; i<len; i++) { if (i%20 == 0) fputs("\n", fp); @@ -1076,7 +1077,7 @@ dump_irep_struct(mrb_state *mrb, const mrb_irep *irep, uint8_t flags, FILE *fp, } /* dump irep */ fprintf(fp, "static const mrb_irep %s_irep_%d = {\n", name, n); - fprintf(fp, " %d,%d,\n", irep->nlocals, irep->nregs); + fprintf(fp, " %d,%d,%d,\n", irep->nlocals, irep->nregs, irep->clen); fprintf(fp, " MRB_IREP_STATIC,%s_iseq_%d,\n", name, n); if (irep->pool) { fprintf(fp, " %s_pool_%d,", name, n); diff --git a/src/proc.c b/src/proc.c index 14ba407d8..de463df3e 100644 --- a/src/proc.c +++ b/src/proc.c @@ -17,6 +17,7 @@ static const mrb_code call_iseq[] = { static const mrb_irep call_irep = { 0, /* nlocals */ 2, /* nregs */ + 0, /* clen */ MRB_ISEQ_NO_FREE | MRB_IREP_NO_FREE, /* flags */ call_iseq, /* iseq */ NULL, /* pool */ @@ -875,7 +875,7 @@ break_tag_p(struct RBreak *brk, uint32_t tag) } static void -prepare_tagged_break(mrb_state *mrb, uint32_t tag, struct RProc *proc, mrb_value val) +prepare_tagged_break(mrb_state *mrb, uint32_t tag, const struct RProc *proc, mrb_value val) { if (break_tag_p((struct RBreak*)mrb->exc, tag)) { mrb_break_tag_set((struct RBreak*)mrb->exc, tag); |
