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 | 27e671a66b2cc5583272a07bd5a88f4e0a6834ac (patch) | |
tree | 37fcff1a48b0bb7c2651ec43e936dcf7632113ff | |
parent | ea764edd5cdb4387f42de8e3bc5e443a05b3bf29 (diff) | |
download | txr-27e671a66b2cc5583272a07bd5a88f4e0a6834ac.tar.gz txr-27e671a66b2cc5583272a07bd5a88f4e0a6834ac.tar.bz2 txr-27e671a66b2cc5583272a07bd5a88f4e0a6834ac.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.
-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); |