aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2024-11-09 17:57:02 -0500
committerBruce Hill <bruce@bruce-hill.com>2024-11-09 17:57:02 -0500
commit5b8f7179ad28e615d1cc40753125f4f296dd5b59 (patch)
tree42064e3531dc042998a96adbcb72eb883bf92517
parent0df908f55fd7f617be35f7fe7a48f2eee1b19d57 (diff)
Bugfix for pointer iterations
-rw-r--r--compile.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/compile.c b/compile.c
index 85aab1a5..ca09b59c 100644
--- a/compile.c
+++ b/compile.c
@@ -1259,17 +1259,10 @@ CORD compile_statement(env_t *env, ast_t *ast)
loop,
"ARRAY_DECREF(t->entries);\n"
"}\n");
- } else if (can_be_mutated(env, for_->iter)) {
- loop = CORD_all(
- "{\n",
- "Table_t t = ", compile_to_pointer_depth(env, for_->iter, 0, false), ";\n"
- "Array_t iterating = t.entries;\n",
- loop,
- "}\n");
} else {
loop = CORD_all(
"{\n",
- "Array_t iterating = (", compile(env, for_->iter), ").entries;\n",
+ "Array_t iterating = (", compile_to_pointer_depth(env, for_->iter, 0, false), ").entries;\n",
loop,
"}\n");
}