More refcount fixes

This commit is contained in:
Bruce Hill 2024-08-04 17:27:43 -04:00
parent d7e3d399d6
commit 7fd74553f8

View File

@ -2143,7 +2143,7 @@ CORD compile(env_t *env, ast_t *ast)
if (align > 1 && offset % align > 0)
offset += align - (offset % align);
return CORD_all("({ table_t *t = ", compile_to_pointer_depth(env, f->fielded, 1, false), ";\n"
"ARRAY_INCREF(t->entries.data_refcount);\n"
"ARRAY_INCREF(t->entries);\n"
"(array_t){.data = t->entries.data + ", CORD_asprintf("%zu", offset),
",\n .length=t->entries.length,\n .stride=t->entries.stride,\n .data_refcount=3};})");
} else if (streq(f->field, "fallback")) {