summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2024-02-27 15:41:30 -0800
committerKaz Kylheku <kaz@kylheku.com>2024-02-27 15:41:30 -0800
commitd36f90235fcf1561a43bf79283a40b042efff84a (patch)
treeedd9a464e4a13df41fde6e5be7953d08c641be81
parent4da3f8cc20d4e0f23df2470120b6f2a6a1754bc9 (diff)
downloadtxr-d36f90235fcf1561a43bf79283a40b042efff84a.tar.gz
txr-d36f90235fcf1561a43bf79283a40b042efff84a.tar.bz2
txr-d36f90235fcf1561a43bf79283a40b042efff84a.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.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib.c b/lib.c
index 9c8d5dec..8d928c66 100644
--- a/lib.c
+++ b/lib.c
@@ -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