From eb2dde72e3756cd2d057e7580903f35d09a12672 Mon Sep 17 00:00:00 2001 From: Sage Vaillancourt Date: Mon, 4 Apr 2022 21:08:18 -0400 Subject: [PATCH] Small envForLambda() fix. All tests are passing now, though there may still be a small leak. --- src/env.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/env.c b/src/env.c index edd49a3..bfc8f07 100644 --- a/src/env.c +++ b/src/env.c @@ -103,7 +103,7 @@ struct Environment envForLambda(const Object* params, const Object* arg_forms, i } struct Environment env = { - .outer = outer, + .outer = NULL, .table = buildTable(4), .refs = 1, }; @@ -125,6 +125,7 @@ struct Environment envForLambda(const Object* params, const Object* arg_forms, i cleanObject(&newEnvObj); march = march ? march->forward : NULL; } + env.outer = outer; return env; }