diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2024-01-06 22:47:42 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2024-01-06 22:47:42 -0800 |
commit | 5464e5ab1ae7d1eeba1dfbea36bc5e81714d1694 (patch) | |
tree | 79a45d2cc0855ffa56de1291b827812f6a03bda0 | |
parent | a0ab563c96bb9b96bce3c5f24af71b821bacdfde (diff) | |
download | txr-5464e5ab1ae7d1eeba1dfbea36bc5e81714d1694.tar.gz txr-5464e5ab1ae7d1eeba1dfbea36bc5e81714d1694.tar.bz2 txr-5464e5ab1ae7d1eeba1dfbea36bc5e81714d1694.zip |
eval: potential gc problem in binding.
* eval.c (reparent_env): This function is used in bindings
helper, when special variables are involved. It makes a new
environment the parent of an existing one, just by assigning
the pointer. This is wrong under generational GC if it makes
a mature object point to a new object. We fix it with the set
macro. I've not seen a crash because of this; I caught it by
inspection.
-rw-r--r-- | eval.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -759,7 +759,7 @@ static val lookup_symac_lisp1(val menv, val sym) static val reparent_env(val child, val parent) { - child->e.up_env = parent; + set(mkloc(child->e.up_env, child), parent); return child; } |