diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2024-08-04 17:23:42 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2024-08-04 17:23:42 -0400 |
| commit | 43501f7bec61d8e8e4430c2226b86579d91a9450 (patch) | |
| tree | 5675d3a27546e9d068d3f232403060b986129348 | |
| parent | fa0dee19e2259194f3d3d797f83917e92385df8f (diff) | |
Minor fix for array refcounting
| -rw-r--r-- | compile.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -2170,7 +2170,7 @@ CORD compile(env_t *env, ast_t *ast) if (ptr->is_optional) code_err(ast, "This pointer is potentially null, so it can't be safely dereferenced"); if (ptr->pointed->tag == ArrayType) { - return CORD_all("({ array_t *arr = ", compile(env, indexing->indexed), "; arr->data_refcount = 3; *arr; })"); + return CORD_all("({ array_t *arr = ", compile(env, indexing->indexed), "; ARRAY_INCREF(*arr); *arr; })"); } else if (ptr->pointed->tag == TableType) { return CORD_all("({ table_t *t = ", compile(env, indexing->indexed), "; Table$mark_copy_on_write(t); *t; })"); } else { |
