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 /lib.c | |
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!
Diffstat (limited to 'lib.c')
-rw-r--r-- | lib.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -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) |