diff options
Diffstat (limited to 'src/ejit.c')
-rw-r--r-- | src/ejit.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -37,6 +37,7 @@ struct ejit_func *ejit_create_func(enum ejit_type rtype, size_t argc, const stru f->rtype = rtype; f->insns = vec_create(sizeof(struct ejit_insn)); + f->labels = vec_create(sizeof(size_t)); f->arena = NULL; f->size = 0; @@ -84,13 +85,14 @@ void ejit_destroy_func(struct ejit_func *f) munmap(f->arena, f->size); vec_destroy(&f->insns); + vec_destroy(&f->labels); free(f); } struct ejit_label ejit_label(struct ejit_func *f) { size_t addr = vec_len(&f->insns); - emit_insn_r(f, LABEL, 0, 0, 0); + vec_append(&f->labels, &addr); return (struct ejit_label){.addr = addr}; } |