diff --git a/extlib/benz/include/picrin/irep.h b/extlib/benz/include/picrin/irep.h index cf612c0e..bba4e2f3 100644 --- a/extlib/benz/include/picrin/irep.h +++ b/extlib/benz/include/picrin/irep.h @@ -60,6 +60,11 @@ struct pic_code { } u; }; +#define PIC_INIT_CODE_I(code, op, ival) do { \ + code.insn = op; \ + code.u.i = ival; \ + } while (0) + struct pic_irep { PIC_OBJECT_HEADER pic_sym *name; diff --git a/extlib/benz/vm.c b/extlib/benz/vm.c index 682a873c..5b426cd8 100644 --- a/extlib/benz/vm.c +++ b/extlib/benz/vm.c @@ -1151,14 +1151,14 @@ pic_apply(pic_state *pic, struct pic_proc *proc, pic_value args) pic_value pic_apply_trampoline(pic_state *pic, struct pic_proc *proc, pic_value args) { - static const pic_code iseq[2] = { - { OP_NOP, { .i = 0 } }, - { OP_TAILCALL, { .i = -1 } } - }; + static pic_code iseq[2]; pic_value v, it, *sp; pic_callinfo *ci; + PIC_INIT_CODE_I(iseq[0], OP_NOP, 0); + PIC_INIT_CODE_I(iseq[1], OP_TAILCALL, -1); + *pic->sp++ = pic_obj_value(proc); sp = pic->sp;