diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2024-08-12 17:44:05 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2024-08-12 17:44:05 -0400 |
| commit | 6aabed4fcc6823466e78593b93ceadd095f7463f (patch) | |
| tree | 8d3e48568b1cd9a312a3d4c548aa67489fffaa39 /ast.c | |
| parent | c139ba2aae50222595bc95db804ab5ded74ba51c (diff) | |
Fix some COW bugs for arrays/tables/sets
Diffstat (limited to 'ast.c')
| -rw-r--r-- | ast.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -200,7 +200,7 @@ bool is_idempotent(ast_t *ast) case Int: case Bool: case Num: case Var: case Nil: case TextLiteral: return true; case Index: { auto index = Match(ast, Index); - return (index->index == NULL) && is_idempotent(index->indexed); + return is_idempotent(index->indexed) && index->index != NULL && is_idempotent(index->index); } case FieldAccess: { auto access = Match(ast, FieldAccess); |
