From 9735057bc3700b9b4df24e3be18263e159c7bdec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Kochma=C5=84ski?= Date: Sun, 2 Jul 2017 22:35:37 +0200 Subject: [PATCH] stacks: don't call si_set_finalizer si_set_finalizer is CL-world function and returns 0 values. That means in particular, that env->nvalues is changed. In this situation, when new binding was introduced, we could lose our nvalues, what lead to invalid multiple-value-bind (next commit will contain a regression test). We use unprotected version. If interrupts cause problems with it, we may need to wrap it in disable_interrupts. Threading code uses ecl_set_finalizer_unprotected without such wrapping though, so I believe that should be safe. Fixes #233. --- src/c/stacks.d | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/c/stacks.d b/src/c/stacks.d index e74e7efbd..ce3e74a03 100644 --- a/src/c/stacks.d +++ b/src/c/stacks.d @@ -274,7 +274,7 @@ ecl_new_binding_index(cl_env_ptr env, cl_object symbol) symbol->symbol.binding = new_index; symbol->symbol.dynamic |= 1; } - si_set_finalizer(symbol, ECL_T); + ecl_set_finalizer_unprotected(symbol, ECL_T); return new_index; }