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 | 527a247ee090efb089ae68fe793ce51fb6aa720a (patch) | |
tree | 79a45d2cc0855ffa56de1291b827812f6a03bda0 | |
parent | d84e1581e949ea301db9d9d567edee04b613991e (diff) | |
download | txr-527a247ee090efb089ae68fe793ce51fb6aa720a.tar.gz txr-527a247ee090efb089ae68fe793ce51fb6aa720a.tar.bz2 txr-527a247ee090efb089ae68fe793ce51fb6aa720a.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; } |