From 565ed858fe87a74862805772b4b7c1665504f441 Mon Sep 17 00:00:00 2001 From: Alex Shinn Date: Wed, 23 Jun 2010 22:04:38 +0900 Subject: [PATCH] fixing memory leak when redefining macros (was generating a new env cell instead of overwriting the old one) --- eval.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eval.c b/eval.c index 5e8170a1..e5cf0c79 100644 --- a/eval.c +++ b/eval.c @@ -665,7 +665,7 @@ static sexp analyze_bind_syntax (sexp ls, sexp eval_ctx, sexp bind_ctx) { if (sexp_synclop(name) && sexp_env_global_p(sexp_context_env(bind_ctx))) name = sexp_synclo_expr(name); mac = sexp_make_macro(eval_ctx, proc, sexp_context_env(bind_ctx)); - sexp_env_push(eval_ctx, sexp_context_env(bind_ctx), tmp, name, mac); + sexp_env_define(eval_ctx, sexp_context_env(bind_ctx), name, mac); } else { res = (sexp_exceptionp(proc) ? proc : sexp_compile_error(eval_ctx, "non-procedure macro:", proc));