codegen.c (mrb_last_insn): no previous instruction on top.
MODIFY
mrbgems/mruby-compiler/core/codegen.c
mrbgems/mruby-compiler/core/codegen.c
@@ -467,6 +467,10 @@ mrb_prev_pc(codegen_scope *s, const mrb_code *pc)
static struct mrb_insn_data
mrb_last_insn(codegen_scope *s)
{
+ if (s->pc == 0) {
+ struct mrb_insn_data data = { OP_NOP, 0 };
+ return data;
+ }
return mrb_decode_insn(&s->iseq[s->lastpc]);
}

codegen.c (mrb_last_insn): no previous instruction on top.