interpreter: don't create closures for null lexenv

We have created empty closure for instance when flet was in null lexenv. Check
for Null in close_over and create t_bclosure only for non-null lexical
environments.
This commit is contained in:
Daniel Kochmanski 2018-02-12 16:01:26 +01:00
parent 67e9c5bef0
commit 857ea3d928

View file

@ -206,9 +206,11 @@ _ecl_bclosure_dispatch_vararg(cl_narg narg, ...)
static cl_object
close_around(cl_object fun, cl_object lex) {
cl_object v = ecl_alloc_object(t_bclosure);
cl_object v;
if (Null(lex)) return fun;
if (ecl_t_of(fun) != t_bytecodes)
FEerror("!!!", 0);
v = ecl_alloc_object(t_bclosure);
v->bclosure.code = fun;
v->bclosure.lex = lex;
v->bclosure.entry = _ecl_bclosure_dispatch_vararg;