diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2015-05-13 20:13:29 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2015-05-13 20:13:29 -0700 |
commit | 5a383a288d620b9ae6111d9f33b9e420d3fcd0f8 (patch) | |
tree | 7677e1e5b0c6ba83c5f590c70d2f8d24128c514a | |
parent | 305c3638096b12715ee37904fc46f37b7fa0baa6 (diff) | |
download | txr-5a383a288d620b9ae6111d9f33b9e420d3fcd0f8.tar.gz txr-5a383a288d620b9ae6111d9f33b9e420d3fcd0f8.tar.bz2 txr-5a383a288d620b9ae6111d9f33b9e420d3fcd0f8.zip |
Recursive lcons force bug (keep-if*, remove-if*).
* lib.c (rem_lazy_func): Do not access the cdr field of
the lcons that we are in the middle of forcing!
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | lib.c | 4 |
2 files changed, 10 insertions, 1 deletions
@@ -1,5 +1,12 @@ 2015-05-13 Kaz Kylheku <kaz@kylheku.com> + Recursive lcons force bug (keep-if*, remove-if*). + + * lib.c (rem_lazy_func): Do not access the cdr field of + the lcons that we are in the middle of forcing! + +2015-05-13 Kaz Kylheku <kaz@kylheku.com> + * place.tl (define-modify-macro): New macro. * lisplib.c (set_place_dlt_entries): Add define-modify-macro. @@ -1153,7 +1153,9 @@ static val rem_lazy_rec(val obj, val list, val env, val func); static val rem_lazy_func(val env, val lcons) { cons_bind (pred, list, env); - return cdr(rplacd(lcons, rem_lazy_rec(pred, list, env, lcons_fun(lcons)))); + val rest = rem_lazy_rec(pred, list, env, lcons_fun(lcons)); + rplacd(lcons, rem_lazy_rec(pred, list, env, lcons_fun(lcons))); + return rest; } static val rem_lazy_rec(val pred, val list, val env, val func) |