fix vm returning without doing gc reset
This commit is contained in:
parent
f76c4f9af9
commit
fd8c7e7cc5
1 changed files with 4 additions and 2 deletions
4
src/vm.c
4
src/vm.c
|
|
@ -279,7 +279,7 @@ I vm_run(Vm *vm, Bc *chunk, I offset) {
|
||||||
vm->chunk = frame.chunk;
|
vm->chunk = frame.chunk;
|
||||||
vm->ip = frame.ip;
|
vm->ip = frame.ip;
|
||||||
} else {
|
} else {
|
||||||
return 1;
|
goto done;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case OP_CHOOSE: {
|
case OP_CHOOSE: {
|
||||||
|
|
@ -324,5 +324,7 @@ I vm_run(Vm *vm, Bc *chunk, I offset) {
|
||||||
vm_error(vm, VM_ERR_RUNTIME, "unknown opcode");
|
vm_error(vm, VM_ERR_RUNTIME, "unknown opcode");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
done:
|
||||||
|
gc_reset(&vm->gc, mark);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue