From ae37828dbaec1748621173650cd8dfe62059565e Mon Sep 17 00:00:00 2001 From: iamcheeseman Date: Mon, 6 Apr 2026 19:55:34 -0400 Subject: fix: crash on undefined variable usage --- uscript/parser.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/uscript/parser.c b/uscript/parser.c index c51bc85..857fad3 100644 --- a/uscript/parser.c +++ b/uscript/parser.c @@ -170,6 +170,9 @@ void declare_variable(struct parser *p, struct token name) static int find_local(struct func_parser *fp, struct token name) { + if (fp == NULL) + return -1; + for (int i = da_len(fp->locals) - 1; i >= 0; i--) { struct variable local = fp->locals[i]; if ( -- cgit v1.3-2-g0d8e