summaryrefslogtreecommitdiffstats
path: root/lib.h
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2024-06-18 03:34:35 -0700
committerKaz Kylheku <kaz@kylheku.com>2024-06-18 03:34:35 -0700
commitdd839dc6ed1abf51645f5e69572ab9e106272c33 (patch)
tree1c5187356f4b8c0f728199bf55399a025d1a118a /lib.h
parent213d60b7200b7c1a1085fb239becd8e2f977b6e3 (diff)
downloadtxr-dd839dc6ed1abf51645f5e69572ab9e106272c33.tar.gz
txr-dd839dc6ed1abf51645f5e69572ab9e106272c33.tar.bz2
txr-dd839dc6ed1abf51645f5e69572ab9e106272c33.zip
bugfix: several seq_iter kinds need clone operation.
Several seq_iter_t kinds of objects cannot be correctly bitwise copied, because they point to an iterator object that cannot be shared. * lib.c (seq_iter_clone_op): New static function. (si_hash_ops, si_tree_ops, si_oop_ops, si_fast_oop_ops): Use seq_iter_clone_op, which uses the copy function to duplicate it->ui.iter after doing a bitwise copy of the structure. * lib.h (seq_iter_ops_init_full): New macro.
Diffstat (limited to 'lib.h')
-rw-r--r--lib.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib.h b/lib.h
index 18037392..0c300e8a 100644
--- a/lib.h
+++ b/lib.h
@@ -474,6 +474,8 @@ struct seq_iter_ops {
#define seq_iter_ops_init_mark(get, peek, mark) { get, peek, mark, 0 }
#define seq_iter_ops_init_clone(get, peek, clone) \
{ get, peek, seq_iter_mark_op, clone }
+#define seq_iter_ops_init_full(get, peek, mark, clone) \
+ { get, peek, mark, clone }
typedef struct seq_build {
val obj;