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 | 53de115df56ecea965a689d049f4ac1c068ebf9c (patch) | |
tree | 3b2c58c181db484934fdbd621364c6dcbb6caddd | |
parent | e3f4cae0d0d14e4815544e2d77739a79f4ab7e91 (diff) | |
download | txr-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.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: |