From 71a0bb70a3b104646ba984f40bf0d6c996a58bc5 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Fri, 12 Feb 2021 19:33:08 -0800 Subject: printer: lambda bugfix. * lib.c (obj_print_impl): Don't pass non-symbols to fboundp. This causes a problem in the case where we are printing an object like ((lambda ...) ...). The car of this object is the (lambda ...) form. When when pass this to fboundp, the underlying function lookup mechanism wants to turn it into a function object and tries to expand it. This can error out if the lambda has bad syntax, which can happen because it's just data that we are trying to print. --- lib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib.c b/lib.c index 1abd6b83..f6c57552 100644 --- a/lib.c +++ b/lib.c @@ -12486,7 +12486,7 @@ val obj_print_impl(val obj, val out, val pretty, struct strm_ctx *ctx) } else if (special_operator_p(sym) || macro_form_p(obj, nil)) { indent = one; test_neq_set_indent_mode(out, num_fast(indent_foff), num_fast(indent_code)); - } else if (fboundp(sym)) { + } else if (symbolp(sym) && fboundp(sym)) { obj_print_impl(sym, out, pretty, ctx); indent = one; save_indent = inc_indent(out, indent); -- cgit v1.2.3