mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-07-03 11:16:36 +02:00
adding type check to lookup-type
This commit is contained in:
parent
ec21e90e16
commit
7d3d700300
1 changed files with 3 additions and 1 deletions
4
sexp.c
4
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)
|
||||
|
|
Loading…
Add table
Reference in a new issue