mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Adjust PR #5060 to the latest mruby3 branch.
This commit is contained in:
@@ -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 */
|
||||
|
||||
+1
-1
@@ -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,
|
||||
};
|
||||
|
||||
+3
-2
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user