From 3b52d30af1c233970b0d69de6a8e45e0f1cbeae8 Mon Sep 17 00:00:00 2001 From: Alex Shinn Date: Mon, 25 Feb 2013 08:03:06 +0900 Subject: [PATCH] Checking for null objects in type-of. --- lib/chibi/ast.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/chibi/ast.c b/lib/chibi/ast.c index 2d3698b0..359f7caa 100644 --- a/lib/chibi/ast.c +++ b/lib/chibi/ast.c @@ -174,6 +174,8 @@ static sexp sexp_set_port_line (sexp ctx, sexp self, sexp_sint_t n, sexp p, sexp } static sexp sexp_type_of (sexp ctx, sexp self, sexp_sint_t n, sexp x) { + if (!x) + return sexp_type_by_index(ctx, SEXP_OBJECT); if (sexp_pointerp(x)) return sexp_object_type(ctx, x); else if (sexp_fixnump(x))