From 005baf51e44ea40387717665aac2e6b9ec5fd617 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Mon, 20 Apr 2020 07:04:25 -0700 Subject: seq_info: bugfix: uninitialized type field. * lib.c (seq_info): Ensure the type field in the returned structure is inintialized. We are neglecting this when the type is COBJ, initializing only the kind field. This makes the in function behave unreliably over arguments that are hash tables, or vector-like sequences (objects with a length function or the carray type). Several other functions will behave unreliably for vector-like sequences: reverse, find, rfind, pos, rpos and tprint. --- lib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib.c b/lib.c index 871c1131..9133f024 100644 --- a/lib.c +++ b/lib.c @@ -286,9 +286,9 @@ seq_info_t seq_info(val obj) type_t to = type(obj); ret.obj = obj; + ret.type = to; if (to != COBJ) { - ret.type = to; ret.kind = seq_kind_tab[to]; return ret; } else { -- cgit v1.2.3