From 0bcfe2aa4452ecbc61ebdc8071ad042d2289682c Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Tue, 20 Dec 2016 16:02:59 -0800 Subject: Bugfix: sys:unbound mechanism lacks hygiene. The genvim.txr program iterates over package symbols and encounters sys:unbound. It binds that to a local variable, creating a problem due to the special hack. Let's turn sys:unbound into a gensym. * eval.c (eval_init): Protect unbound_s from gc. Initialize unbound_s with an uninterned symbol created by make_sym. --- eval.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'eval.c') diff --git a/eval.c b/eval.c index ddf3b944..251a5743 100644 --- a/eval.c +++ b/eval.c @@ -4897,7 +4897,7 @@ void eval_init(void) protect(&top_vb, &top_fb, &top_mb, &top_smb, &special, &builtin, &dyn_env, &op_table, &last_form_evaled, &last_form_expanded, - &call_f, &origin_hash, convert(val *, 0)); + &call_f, &unbound_s, &origin_hash, convert(val *, 0)); top_fb = make_hash(t, nil, nil); top_vb = make_hash(t, nil, nil); top_mb = make_hash(t, nil, nil); @@ -5013,7 +5013,7 @@ void eval_init(void) whole_k = intern(lit("whole"), keyword_package); form_k = intern(lit("form"), keyword_package); special_s = intern(lit("special"), system_package); - unbound_s = intern(lit("unbound"), system_package); + unbound_s = make_sym(lit("unbound")); symacro_k = intern(lit("symacro"), keyword_package); prof_s = intern(lit("prof"), user_package); switch_s = intern(lit("switch"), system_package); -- cgit v1.2.3