summaryrefslogtreecommitdiffstats
path: root/lib.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2021-02-02 19:41:21 -0800
committerKaz Kylheku <kaz@kylheku.com>2021-02-02 19:41:21 -0800
commit0be51ece438ea98a7b4f27f3f75b5ffc90fd6663 (patch)
tree3b2c58c181db484934fdbd621364c6dcbb6caddd /lib.c
parent78b460717e5fda8bb461101775d2298d365a78a6 (diff)
downloadtxr-0be51ece438ea98a7b4f27f3f75b5ffc90fd6663.tar.gz
txr-0be51ece438ea98a7b4f27f3f75b5ffc90fd6663.tar.bz2
txr-0be51ece438ea98a7b4f27f3f75b5ffc90fd6663.zip
lib: fix crash in iterable and nullify.
* lib.c (seq_iterable): In the COBJ case, we must check whether the object is a structure before accessing get_special_slot. For instance (nullify #/a/) crashes because a regex is a COBJ but not a struct.
Diffstat (limited to 'lib.c')
-rw-r--r--lib.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib.c b/lib.c
index c4f191bc..196a6b56 100644
--- a/lib.c
+++ b/lib.c
@@ -349,7 +349,7 @@ static val seq_iterable(seq_info_t si)
case FLNUM:
return t;
case COBJ:
- if (get_special_slot(si.obj, iter_begin_m))
+ if (obj_struct_p(si.obj) && get_special_slot(si.obj, iter_begin_m))
return t;
break;
default: