summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2015-11-28 19:21:17 -0800
committerKaz Kylheku <kaz@kylheku.com>2015-11-28 19:21:17 -0800
commit24b5694c9fe7437322e09929527d98c7bee1408a (patch)
treea2d7e349bca7acfea1a11c8465fee99117293479
parent8bd9d47e3c25bfd964bb6950362d169c49887b66 (diff)
downloadtxr-24b5694c9fe7437322e09929527d98c7bee1408a.tar.gz
txr-24b5694c9fe7437322e09929527d98c7bee1408a.tar.bz2
txr-24b5694c9fe7437322e09929527d98c7bee1408a.zip
Bugfix: destructive behavior in transpose.
* lib.c (transpose): This function turns an input list into an argument list which ends up in an args structure, which potentially destroys it to prevent spurious retention. The list must be copied. We don't use copy-list because the function supports vectors.
-rw-r--r--lib.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib.c b/lib.c
index 39686e3d..26f3cd9e 100644
--- a/lib.c
+++ b/lib.c
@@ -5377,7 +5377,7 @@ val transposev(struct args *list)
val transpose(val list)
{
- args_decl_list(args, ARGS_MIN, list);
+ args_decl_list(args, ARGS_MIN, copy(list));
return make_like(transposev(args), list);
}