diff options
-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) |