From f87d50f053f3f2f34f92c6001bcdd79a452a3cbf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Kochma=C5=84ski?= Date: Sun, 24 Feb 2019 14:22:13 +0100 Subject: [PATCH] bytecmp: tagbody: ensure ECL_NIL->ECL_NIL_SYMBOL conversion Issue comes from the fact that list and symbol types are not disjoint. Fixes #475. My personal opinion (to put some rambling in a commit message) is that having NIL being so many things is a blatant mistake and shouldn't be picked up for Common Lisp (though many programs would probably break and it wouldn't be so Common then). --- src/c/compiler.d | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/c/compiler.d b/src/c/compiler.d index 6c603ca28..43cd27799 100644 --- a/src/c/compiler.d +++ b/src/c/compiler.d @@ -1473,6 +1473,9 @@ asm_function(cl_env_ptr env, cl_object function, int flags) { static int c_go(cl_env_ptr env, cl_object args, int flags) { cl_object tag = pop(&args); + if (Null(tag)) { + tag = ECL_NIL_SYMBOL; + } cl_object info = c_tag_ref(env, tag, @':tag'); if (Null(info)) FEprogram_error("GO: Unknown tag ~S.", 1, tag); @@ -2060,6 +2063,9 @@ c_tagbody(cl_env_ptr env, cl_object args, int flags) /* count the tags */ for (nt = 0, body = args; !Null(body); ) { label = pop(&body); + if (Null(label)) { + label = ECL_NIL_SYMBOL; + } item_type = ecl_t_of(label); if (item_type == t_symbol || item_type == t_fixnum || item_type == t_bignum) { @@ -2080,6 +2086,9 @@ c_tagbody(cl_env_ptr env, cl_object args, int flags) for (body = args; !Null(body); ) { label = pop(&body); + if (Null(label)) { + label = ECL_NIL_SYMBOL; + } item_type = ecl_t_of(label); if (item_type == t_symbol || item_type == t_fixnum || item_type == t_bignum) {