summaryrefslogtreecommitdiffstats
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
commit53de115df56ecea965a689d049f4ac1c068ebf9c (patch)
tree3b2c58c181db484934fdbd621364c6dcbb6caddd
parente3f4cae0d0d14e4815544e2d77739a79f4ab7e91 (diff)
downloadtxr-53de115df56ecea965a689d049f4ac1c068ebf9c.tar.gz
txr-53de115df56ecea965a689d049f4ac1c068ebf9c.tar.bz2
txr-53de115df56ecea965a689d049f4ac1c068ebf9c.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.
-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: