diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2021-02-02 19:41:21 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2021-02-02 19:41:21 -0800 |
commit | 0be51ece438ea98a7b4f27f3f75b5ffc90fd6663 (patch) | |
tree | 3b2c58c181db484934fdbd621364c6dcbb6caddd /lib.c | |
parent | 78b460717e5fda8bb461101775d2298d365a78a6 (diff) | |
download | txr-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.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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: |