summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2021-09-13 05:22:37 -0700
committerKaz Kylheku <kaz@kylheku.com>2021-09-13 05:22:37 -0700
commitbd959a4747f0a2fffe9aa18b5b94e64ee4ccb3b8 (patch)
tree0991d22e3b7ef96fab81cde8ae7fe3693a6f608d
parenta2fa1cd7306a9f924604c7175e48ac63e4bd0958 (diff)
downloadtxr-bd959a4747f0a2fffe9aa18b5b94e64ee4ccb3b8.tar.gz
txr-bd959a4747f0a2fffe9aa18b5b94e64ee4ccb3b8.tar.bz2
txr-bd959a4747f0a2fffe9aa18b5b94e64ee4ccb3b8.zip
seq_iter: gc crash marking vector iterator.
* lib.c (si_vec_ops): This must be initialized with seq_iter_ops_init_nomark, since it uses a cnum index, and not a val iter; the seq_iter_mark_op will pass the cnum bit pattern to gc_mark an cause a crash. (si_null_ops): While we are at it, this should also use seq_iter_ops_init_nomark, because it->ui.iter is always nil.
-rw-r--r--lib.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib.c b/lib.c
index cb8bcde8..1a681c47 100644
--- a/lib.c
+++ b/lib.c
@@ -866,14 +866,14 @@ static void seq_iter_mark_op(struct seq_iter *it)
gc_mark(it->ui.iter);
}
-struct seq_iter_ops si_null_ops = seq_iter_ops_init(seq_iter_get_nil,
- seq_iter_peek_nil);
+struct seq_iter_ops si_null_ops = seq_iter_ops_init_nomark(seq_iter_get_nil,
+ seq_iter_peek_nil);
struct seq_iter_ops si_list_ops = seq_iter_ops_init(seq_iter_get_list,
seq_iter_peek_list);
-struct seq_iter_ops si_vec_ops = seq_iter_ops_init(seq_iter_get_vec,
- seq_iter_peek_vec);
+struct seq_iter_ops si_vec_ops = seq_iter_ops_init_nomark(seq_iter_get_vec,
+ seq_iter_peek_vec);
struct seq_iter_ops si_hash_ops = seq_iter_ops_init(seq_iter_get_hash,
seq_iter_peek_hash);