Avoiding potential segfault from trying to capture temporary local variables in a macro.

Fixes issue #252.
This commit is contained in:
Alex Shinn 2015-04-14 23:22:48 +09:00
parent 579fcf95ae
commit aa3f869798

2
eval.c
View file

@ -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);