bytecmp: be smart wrt bytecompiled code

bytecompiled functions may not have a name (i.e lambda assigned to
smothing). Recognize that fact, so when we read back such functions
from file we can call bc-compile on them. Fixes #313.
This commit is contained in:
Daniel Kochmanski 2017-10-09 22:45:50 +02:00
parent b851e85701
commit 9ba7440782

View file

@ -130,9 +130,9 @@ cl_function_lambda_expression(cl_object fun)
case t_bytecodes:
name = fun->bytecodes.name;
output = fun->bytecodes.definition;
if (name == ECL_NIL)
if (name == ECL_NIL && output != ECL_NIL)
output = cl_cons(@'lambda', output);
else if (name != @'si::bytecodes')
else if (name != @'si::bytecodes' && output != ECL_NIL)
output = @list*(3, @'ext::lambda-block', name, output);
break;
case t_cfun: