summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2018-01-02 03:08:53 -0800
committerKaz Kylheku <kaz@kylheku.com>2018-01-02 03:08:53 -0800
commit2264eda279ffbbfee97f80cda56db19b8c359072 (patch)
tree9c373224122a1da61500c0fa7c0f7f2e57b24afc
parentc1f589db75f669bcd6c4bb0671fb1d71eb0d5e5a (diff)
downloadtxr-2264eda279ffbbfee97f80cda56db19b8c359072.tar.gz
txr-2264eda279ffbbfee97f80cda56db19b8c359072.tar.bz2
txr-2264eda279ffbbfee97f80cda56db19b8c359072.zip
seq_info: bugfix: wrong object tested obj_struct_p.
* lib.c (seq_info): The obj_struct_p test must be applied to obj, not to cls, which is a symbol. Due to this bug, seq_info would always report struct-based sequences as SEQ_NOTSEQ.
-rw-r--r--lib.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib.c b/lib.c
index 592e95e3..e5857e9c 100644
--- a/lib.c
+++ b/lib.c
@@ -302,7 +302,7 @@ seq_info_t seq_info(val obj)
ret.kind = SEQ_HASHLIKE;
} else if (cls == carray_s) {
ret.kind = SEQ_VECLIKE;
- } else if (obj_struct_p(cls)) {
+ } else if (obj_struct_p(obj)) {
if (maybe_slot(obj, length_s))
ret.kind = SEQ_VECLIKE;
if (maybe_slot(obj, car_s))