aboutsummaryrefslogtreecommitdiff
path: root/src/compile.c
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2025-04-02 15:46:17 -0400
committerBruce Hill <bruce@bruce-hill.com>2025-04-02 15:46:17 -0400
commit65c347be045d843c47a044451599f4b89748ef63 (patch)
tree67867b15d55119aa2a167d98c0e453efbef2b10f /src/compile.c
parentf908205df8d30f417e752e1d8c0dbb3c3fa6c85e (diff)
Bugfix for getting table default values
Diffstat (limited to 'src/compile.c')
-rw-r--r--src/compile.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/compile.c b/src/compile.c
index e9ff1b1f..6c3b51fd 100644
--- a/src/compile.c
+++ b/src/compile.c
@@ -3713,8 +3713,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_setdefault(",
- compile_to_pointer_depth(env, indexing->indexed, 1, false), ", ",
+ return CORD_all("Table$get_or_default(",
+ compile_to_pointer_depth(env, indexing->indexed, 0, false), ", ",
compile_type(table_type->key_type), ", ",
compile_type(value_type), ", ",
compile(env, indexing->index), ", ",