}
ANN static void free_code(MemPool p, Code *code) {
- vector_release(&code->instr);
+ if(code->instr.ptr) vector_release(&code->instr);
vector_release(&code->stack_break);
vector_release(&code->stack_cont);
vector_release(&code->stack_return);
VM_Code code = mp_calloc(p, VM_Code);
code->name = mstrdup(p, name);
if (instr) {
- vector_init(&code->instr);
- vector_copy2(instr, &code->instr);
+ code->instr.ptr = instr->ptr;
+ instr->ptr = NULL;
code->bytecode = tobytecode(p, code);
}
if (live_values) code->live_values.ptr = live_values->ptr;