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.
This commit is contained in:
Daniel Kochmański 2017-07-02 22:35:37 +02:00
parent 355d15db3a
commit 9735057bc3

View file

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