From aa3f869798037bf2fde251deacf66936db379c5a Mon Sep 17 00:00:00 2001 From: Alex Shinn Date: Tue, 14 Apr 2015 23:22:48 +0900 Subject: [PATCH] Avoiding potential segfault from trying to capture temporary local variables in a macro. Fixes issue #252. --- eval.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eval.c b/eval.c index 41fa97ba..d195eb6c 100644 --- a/eval.c +++ b/eval.c @@ -100,7 +100,7 @@ static sexp sexp_env_cell_loc1 (sexp env, sexp key, int localp, sexp *varenv) { static sexp sexp_env_cell_loc (sexp ctx, sexp env, sexp key, int localp, sexp *varenv) { sexp cell = sexp_env_cell_loc1(env, key, localp, varenv); - while (!cell && sexp_synclop(key)) { + while (!cell && key && sexp_synclop(key)) { if (sexp_not(sexp_memq(ctx, sexp_synclo_expr(key), sexp_context_fv(ctx))) && sexp_not(sexp_memq(ctx, sexp_synclo_expr(key), sexp_synclo_free_vars(key)))) env = sexp_synclo_env(key);