Bug fixes

This commit is contained in:
Mid
2025-09-06 13:59:14 +03:00
parent 5809a89eae
commit eb5a23761d
4 changed files with 41 additions and 14 deletions

7
vm.c
View File

@@ -63,9 +63,10 @@ do_getglobal:;
regset->regs[inst->a] = ltable_get(func->env, lvalue_from_string(str));
set_LValueU_insert(heap, lvalue_from_string(str).u);
free(str);
lvm_gc_alert(L, &privates, sizeof(*str) + len);
//set_LValueU_insert(heap, lvalue_from_string(str).u);
//lvm_gc_alert(L, &privates, sizeof(*str) + len);
}
DISPATCH();
@@ -421,7 +422,7 @@ static void gc_mark(LValue v) {
}
static void gc_mark_units(LVM *L) {
for(size_t u = 0; u < L->unit_count; u++) {
LUnit *unit = &L->units[u];
LUnit *unit = L->units[u];
for(size_t f = 0; f < unit->func_count; f++) {
LFunc *func = &unit->funcs[f];
gc_mark(lvalue_from_table(func->env));