aboutsummaryrefslogtreecommitdiff
path: root/src/analyze.c
diff options
context:
space:
mode:
authorKimplul <kimi.h.kuparinen@gmail.com>2026-01-06 17:17:27 +0200
committerKimplul <kimi.h.kuparinen@gmail.com>2026-01-06 17:19:52 +0200
commit99601456e6ad4c86287ba786923c99c5499037e0 (patch)
tree7f834f015cfc5c14e695e0521ae31c4262254dba /src/analyze.c
parent64146b46da45ce69ab380add00459f7b60fe9196 (diff)
downloadfwd-99601456e6ad4c86287ba786923c99c5499037e0.tar.gz
fwd-99601456e6ad4c86287ba786923c99c5499037e0.zip
improve move checker to detect pointer leaksHEADmastergnc
+ Currently requires a lot of unnecessary `forget` statements, but at least some can likely be eliminated by doing some basic origin analysis, kind of like with groups
Diffstat (limited to 'src/analyze.c')
-rw-r--r--src/analyze.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/analyze.c b/src/analyze.c
index 2dc039a..04b7856 100644
--- a/src/analyze.c
+++ b/src/analyze.c
@@ -397,7 +397,6 @@ static int analyze_closure(struct state *state, struct scope *scope,
}
node->scope = closure_scope;
- closure_scope->flags |= SCOPE_PROC;
scope_add_scope(scope, closure_scope);
if (analyze_list(state, closure_scope, closure_bindings(node)))
@@ -777,6 +776,9 @@ static int analyze_nil_check(struct state *state, struct scope *scope, struct as
return -1;
}
+ if (analyze(state, scope, nil_check_rest(node)))
+ return -1;
+
node->t = tgen_void(node->loc);
return 0;
}