diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2016-12-20 16:02:59 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2016-12-20 16:02:59 -0800 |
commit | 0bcfe2aa4452ecbc61ebdc8071ad042d2289682c (patch) | |
tree | 37fcff1a48b0bb7c2651ec43e936dcf7632113ff /eval.c | |
parent | ca824ebb1c3dcf616c0ba89a0c96ca47f2221299 (diff) | |
download | txr-0bcfe2aa4452ecbc61ebdc8071ad042d2289682c.tar.gz txr-0bcfe2aa4452ecbc61ebdc8071ad042d2289682c.tar.bz2 txr-0bcfe2aa4452ecbc61ebdc8071ad042d2289682c.zip |
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.
Diffstat (limited to 'eval.c')
-rw-r--r-- | eval.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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); |