From fcbdf183159a94fd87be610887e076f6339fde28 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Wed, 9 Oct 2024 00:36:00 -0400 Subject: Bugfix for `defer` using enclosing scope --- compile.c | 1 + 1 file changed, 1 insertion(+) (limited to 'compile.c') diff --git a/compile.c b/compile.c index 3018249a..034a4772 100644 --- a/compile.c +++ b/compile.c @@ -2526,6 +2526,7 @@ CORD compile(env_t *env, ast_t *ast) struct { const char *name; binding_t *b; } *entry = Table$entry(*closed_vars, i); if (entry->b->type->tag == ModuleType) continue; + set_binding(body_scope, entry->name, new(binding_t, .type=entry->b->type, .code=CORD_cat("userdata->", entry->name))); def = CORD_all(def, compile_declaration(entry->b->type, entry->name), "; "); } def = CORD_all(def, "} ", name, "$userdata_t;"); -- cgit v1.2.3