From 06fed2b68e08772c606ee6328d8e661e46c571f8 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Fri, 14 Feb 2014 16:00:42 -0800 Subject: * 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. --- ChangeLog | 6 ++++++ lib.c | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 544d470c..513c644b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2014-02-14 Kaz Kylheku + + * 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 * eval.c (eval_init): Register inhash as intrinsic. diff --git a/lib.c b/lib.c index fbc44315..64dfb7d0 100644 --- a/lib.c +++ b/lib.c @@ -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; } -- cgit v1.2.3