diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2024-02-27 15:41:30 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2024-02-27 15:41:30 -0800 |
commit | b0d0a870f00b33f941cbc988ab8fa318aec12d8a (patch) | |
tree | edd9a464e4a13df41fde6e5be7953d08c641be81 | |
parent | ae35620d9fa6a0bd5656952154b7e1866a79b9f5 (diff) | |
download | txr-b0d0a870f00b33f941cbc988ab8fa318aec12d8a.tar.gz txr-b0d0a870f00b33f941cbc988ab8fa318aec12d8a.tar.bz2 txr-b0d0a870f00b33f941cbc988ab8fa318aec12d8a.zip |
seq_build: struct/carray bugfix.
* lib.c (seq_build_struct_finish, seq_build_carray_finish):
These functions are still wrongly assuming that the list
is finished by nreverse. We intead call seq_build_list_finish
for that, which puts the list back into bu->obj.
-rw-r--r-- | lib.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -1498,13 +1498,14 @@ static void seq_build_list_finish(seq_build_t *bu) static void seq_build_struct_finish(seq_build_t *bu) { - bu->obj = funcall1(bu->u.from_list_meth, nreverse(bu->obj)); + seq_build_list_finish(bu); + bu->obj = funcall1(bu->u.from_list_meth, bu->obj); } static void seq_build_carray_finish(seq_build_t *bu) { - bu->obj = carray_list(nreverse(bu->obj), bu->u.carray_type, nil); - + seq_build_list_finish(bu); + bu->obj = carray_list(bu->obj, bu->u.carray_type, nil); } static struct seq_build_ops |