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 --- include/fwd/ast.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/fwd/ast.h b/include/fwd/ast.h index 4c8d412..0fd1118 100644 --- a/include/fwd/ast.h +++ b/include/fwd/ast.h @@ -349,7 +349,7 @@ static inline bool is_trivially_copyable(struct type *type) case TYPE_U32: case TYPE_U64: case TYPE_REF: - case TYPE_PTR: + case TYPE_BOOL: case TYPE_FUNC_PTR: case TYPE_PURE_CLOSURE: return true; @@ -590,6 +590,7 @@ static inline bool is_trivially_copyable(struct type *type) #define nil_check_expr(x) return_a0(x, AST_NIL_CHECK) #define nil_check_body(x) return_a1(x, AST_NIL_CHECK) #define nil_check_ref(x) return_a2(x, AST_NIL_CHECK) +#define nil_check_rest(x) return_a3(x, AST_NIL_CHECK) #define gen_nil_check(expr, body, ref, loc) \ gen3(AST_NIL_CHECK, expr, body, ref, loc) -- cgit v1.2.3