From e0cb8fd076995678fb364556846642d6f1eba8f5 Mon Sep 17 00:00:00 2001 From: Alex Shinn Date: Tue, 27 Jul 2010 00:24:37 +0900 Subject: [PATCH] fixing typo in new opcodes.c --- lib/chibi/ast.c | 6 ++++-- opcodes.c | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/chibi/ast.c b/lib/chibi/ast.c index c25c335c..a1ece368 100644 --- a/lib/chibi/ast.c +++ b/lib/chibi/ast.c @@ -48,7 +48,9 @@ static sexp sexp_get_opcode_name (sexp ctx sexp_api_params(self, n), sexp op) { static sexp sexp_translate_opcode_type (sexp ctx, sexp type) { sexp_gc_var2(res, tmp); res = type; - if (sexp_nullp(res)) { /* opcode list types */ + if (sexp_fixnump(res)) { + res = sexp_type_by_index(ctx, sexp_unbox_fixnum(res)); + } else if (sexp_nullp(res)) { /* opcode list types */ sexp_gc_preserve2(ctx, res, tmp); tmp = sexp_intern(ctx, "or", -1); res = sexp_cons(ctx, sexp_make_fixnum(SEXP_PAIR), SEXP_NULL); @@ -174,7 +176,7 @@ sexp sexp_init_library (sexp ctx sexp_api_params(self, n), sexp env) { sexp_define_foreign(ctx, env, "opcode-name", 1, sexp_get_opcode_name); sexp_define_foreign(ctx, env, "opcode-num-params", 1, sexp_get_opcode_num_params); sexp_define_foreign(ctx, env, "opcode-return-type", 1, sexp_get_opcode_ret_type); - sexp_define_foreign(ctx, env, "opcode-param-type", 1, sexp_get_opcode_param_type); + sexp_define_foreign(ctx, env, "opcode-param-type", 2, sexp_get_opcode_param_type); sexp_define_foreign(ctx, env, "optimize", 1, sexp_optimize); return SEXP_VOID; } diff --git a/opcodes.c b/opcodes.c index ee549122..6b0e5b40 100644 --- a/opcodes.c +++ b/opcodes.c @@ -69,7 +69,7 @@ _OP(SEXP_OPC_TYPE_PREDICATE, SEXP_OP_CHARP, 1, 0, _I(SEXP_OBJECT), SEXP_FALSE, _OP(SEXP_OPC_TYPE_PREDICATE, SEXP_OP_FIXNUMP, 1, 0, _I(SEXP_OBJECT), SEXP_FALSE, 0, "fixnum?", NULL, 0), _OP(SEXP_OPC_TYPE_PREDICATE, SEXP_OP_TYPEP, 1, 0, _I(SEXP_OBJECT), SEXP_FALSE, 0, "pair?", _I(SEXP_PAIR), 0), _OP(SEXP_OPC_TYPE_PREDICATE, SEXP_OP_TYPEP, 1, 0, _I(SEXP_OBJECT), SEXP_FALSE, 0, "string?", _I(SEXP_STRING), 0), -_OP(SEXP_OPC_TYPE_PREDICATE, SEXP_OP_TYPEP, 1, 0, _I(SEXP_OBJECT), SEXP_FALSE, 0, "vector?", _I(_I(SEXP_VECTOR)), 0), +_OP(SEXP_OPC_TYPE_PREDICATE, SEXP_OP_TYPEP, 1, 0, _I(SEXP_OBJECT), SEXP_FALSE, 0, "vector?", _I(SEXP_VECTOR), 0), #if SEXP_USE_IMMEDIATE_FLONUMS _FN1(_I(SEXP_OBJECT), "flonum?", 0, sexp_flonump_op), #else