aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2024-12-24 13:49:47 -0500
committerBruce Hill <bruce@bruce-hill.com>2024-12-24 13:49:47 -0500
commitadd1da2a964cab83818209c99c9b514659036626 (patch)
tree5089b5e111c3c8a40c20891fda3c5bdc77673edf
parentdf1b36cc278663f8376871b5f3d110c320315a36 (diff)
Fix for table default values
-rw-r--r--compile.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/compile.c b/compile.c
index 018827ff..88e2a5d2 100644
--- a/compile.c
+++ b/compile.c
@@ -3681,8 +3681,8 @@ CORD compile(env_t *env, ast_t *ast)
code_err(ast, "Table indexes cannot be unchecked");
if (table_type->default_value) {
type_t *value_type = get_type(env, table_type->default_value);
- return CORD_all("Table$get_or_default(",
- compile_to_pointer_depth(env, indexing->indexed, 0, false), ", ",
+ return CORD_all("*Table$get_or_setdefault(",
+ compile_to_pointer_depth(env, indexing->indexed, 1, false), ", ",
compile_type(table_type->key_type), ", ",
compile_type(value_type), ", ",
compile(env, indexing->index), ", ",