From f78cd6357acf7bd8eae6687f2530201acd522329 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Thu, 8 Aug 2024 13:20:38 -0400 Subject: Change table removal function to use values instead of references --- compile.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'compile.c') diff --git a/compile.c b/compile.c index a141302b..3a632afe 100644 --- a/compile.c +++ b/compile.c @@ -1976,8 +1976,8 @@ CORD compile(env_t *env, ast_t *ast) compile_type_info(env, self_value_t), ")"); } else if (streq(call->name, "remove")) { CORD self = compile_to_pointer_depth(env, call->self, 1, false); - arg_t *arg_spec = new(arg_t, .name="key", .type=Type(PointerType, .pointed=table->key_type, .is_stack=true, .is_readonly=true)); - return CORD_all("Table$remove(", self, ", ", compile_arguments(env, ast, arg_spec, call->args), ", ", + arg_t *arg_spec = new(arg_t, .name="key", .type=table->key_type); + return CORD_all("Table$remove_value(", self, ", ", compile_arguments(env, ast, arg_spec, call->args), ", ", compile_type_info(env, self_value_t), ")"); } else if (streq(call->name, "clear")) { CORD self = compile_to_pointer_depth(env, call->self, 1, false); -- cgit v1.2.3