From 53de115df56ecea965a689d049f4ac1c068ebf9c Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Tue, 2 Feb 2021 19:41:21 -0800 Subject: 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. --- lib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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: -- cgit v1.2.3