From 2a12cb869ba7ae81513e771bb0dab670a80f0e32 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Sun, 22 Dec 2024 15:31:58 -0500 Subject: Bugfixes for table updates and array concat updates --- compile.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'compile.c') diff --git a/compile.c b/compile.c index 38b6f754..018827ff 100644 --- a/compile.c +++ b/compile.c @@ -366,7 +366,7 @@ static CORD compile_lvalue(env_t *env, ast_t *ast) if (table_type->default_value) { type_t *value_type = get_type(env, table_type->default_value); return CORD_all("*Table$get_or_setdefault(", - compile_lvalue(env, index->indexed), ", ", + compile_to_pointer_depth(env, index->indexed, 1, false), ", ", compile_type(table_type->key_type), ", ", compile_type(value_type), ", ", compile(env, index->index), ", ", @@ -871,7 +871,7 @@ CORD compile_statement(env_t *env, ast_t *ast) if (update->lhs->tag == Var) return CORD_all("Array$insert_all(&", lhs, ", ", rhs, ", I(0), ", padded_item_size, ");"); else - return CORD_all(lhs, "Array$concat(", lhs, ", ", rhs, ", ", padded_item_size, ");"); + return CORD_all(lhs, " = Array$concat(", lhs, ", ", rhs, ", ", padded_item_size, ");"); } else { code_err(ast, "'++=' is not implemented for %T types", lhs_t); } @@ -3682,7 +3682,7 @@ CORD compile(env_t *env, ast_t *ast) if (table_type->default_value) { type_t *value_type = get_type(env, table_type->default_value); return CORD_all("Table$get_or_default(", - compile(env, indexing->indexed), ", ", + compile_to_pointer_depth(env, indexing->indexed, 0, false), ", ", compile_type(table_type->key_type), ", ", compile_type(value_type), ", ", compile(env, indexing->index), ", ", -- cgit v1.2.3