From 7d3d700300c54ec7779474b372cfff5a27c49a46 Mon Sep 17 00:00:00 2001 From: Alex Shinn Date: Sat, 19 Jan 2013 01:30:49 +0900 Subject: [PATCH] adding type check to lookup-type --- sexp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sexp.c b/sexp.c index 63bcebc8..50404345 100644 --- a/sexp.c +++ b/sexp.c @@ -332,7 +332,9 @@ sexp sexp_register_simple_type_op (sexp ctx, sexp self, sexp_sint_t n, sexp name sexp sexp_lookup_type_op(sexp ctx, sexp self, sexp_sint_t n, sexp name, sexp id) { int i; sexp res; - const char* str = sexp_string_data(name); + const char* str; + sexp_assert_type(ctx, sexp_stringp, SEXP_STRING, name); + str = sexp_string_data(name); if (sexp_fixnump(id)) { i = sexp_unbox_fixnum(id); if (i < sexp_context_num_types(ctx)