codegen.c: `gen_jmpdst` always needs to generate relative address.
MODIFY
mrbgems/mruby-compiler/core/codegen.c
mrbgems/mruby-compiler/core/codegen.c
@@ -398,9 +398,8 @@ gen_jmpdst(codegen_scope *s, uint32_t pc)
{
if (pc == JMPLINK_START) {
- gen_S(s, 0);
+ pc = 0;
}
- else {
uint32_t pos2 = s->pc+2;
int32_t off = pc - pos2;
@@ -409,7 +408,6 @@ gen_jmpdst(codegen_scope *s, uint32_t pc)
}
gen_S(s, (uint16_t)off);
}
-}
static uint32_t
genjmp(codegen_scope *s, mrb_code i, uint32_t pc)

codegen.c: `gen_jmpdst` always needs to generate relative address.