diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2014-02-14 16:00:42 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2014-02-14 16:00:42 -0800 |
commit | 06fed2b68e08772c606ee6328d8e661e46c571f8 (patch) | |
tree | b2bc47bcab2cee176e9dfe6e2c7c2f91e7655e1e | |
parent | b21d9c695dfb570a459129885063749e6efa561e (diff) | |
download | txr-06fed2b68e08772c606ee6328d8e661e46c571f8.tar.gz txr-06fed2b68e08772c606ee6328d8e661e46c571f8.tar.bz2 txr-06fed2b68e08772c606ee6328d8e661e46c571f8.zip |
* lib.c (class_check): Bugfix: the function was assuming that
the argument is a pointer type object, leading to a crash
if given a fixnum integer or string literal.
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | lib.c | 3 |
2 files changed, 8 insertions, 1 deletions
@@ -1,5 +1,11 @@ 2014-02-14 Kaz Kylheku <kaz@kylheku.com> + * lib.c (class_check): Bugfix: the function was assuming that + the argument is a pointer type object, leading to a crash + if given a fixnum integer or string literal. + +2014-02-14 Kaz Kylheku <kaz@kylheku.com> + * eval.c (eval_init): Register inhash as intrinsic. * hash.c (inhash): New function. @@ -183,7 +183,8 @@ val type_check3(val obj, int t1, int t2, int t3) val class_check(val cobj, val class_sym) { - type_assert (cobj && cobj->t.type == COBJ && cobj->co.cls == class_sym, + type_assert (is_ptr(cobj) && cobj->t.type == COBJ && + cobj->co.cls == class_sym, (lit("~a is not of type ~a"), cobj, class_sym, nao)); return t; } |