From 99601456e6ad4c86287ba786923c99c5499037e0 Mon Sep 17 00:00:00 2001 From: Kimplul Date: Tue, 6 Jan 2026 17:17:27 +0200 Subject: improve move checker to detect pointer leaks + 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 --- src/analyze.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/analyze.c') 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; } -- cgit v1.2.3