diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2021-07-29 07:56:44 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2021-07-29 07:56:44 -0700 |
commit | 53872969cc7c6a52ff2d92b9da1bba8000c45522 (patch) | |
tree | b394820faf54dd9db3ee999ee5fc9ff58883eb9a /tests | |
parent | 13994ed823c2445bbeecea677fd604744b373c5e (diff) | |
download | txr-53872969cc7c6a52ff2d92b9da1bba8000c45522.tar.gz txr-53872969cc7c6a52ff2d92b9da1bba8000c45522.tar.bz2 txr-53872969cc7c6a52ff2d92b9da1bba8000c45522.zip |
gc: problem in environment-copying functions.
* eval.c (copy_env, deep_copy_env): These functions are not following
a protocol for object construction that is correct under generational
GC. They are allocating a new object with make_obj first, and then
calling functions to copy the constituent elements to populate into
the object with a direct assignment. This direct assignment is wrong;
the set macro is required. A better fix, rather than using the set
macro, is to copy the constituent parts first, holding them in local
variables, then allocate the new object, and finally, without doing any
other memory allocating operations, assign the constituent parts into
the new object.
Diffstat (limited to 'tests')
0 files changed, 0 insertions, 0 deletions