diff --git a/include/chibi/sexp.h b/include/chibi/sexp.h index 57722e57..3a2c75cb 100644 --- a/include/chibi/sexp.h +++ b/include/chibi/sexp.h @@ -1051,9 +1051,9 @@ SEXP_API void sexp_maybe_unblock_port (sexp ctx, sexp in); if (sexp_maybe_block_port(ctx, in, forcep)) \ return sexp_global(ctx, SEXP_G_IO_BLOCK_ERROR) #else -#define sexp_maybe_block_port(ctx, in, forcep) 0 -#define sexp_maybe_unblock_port(ctx, in) 0 -#define sexp_check_block_port(ctx, in, forcep) 0 +#define sexp_maybe_block_port(ctx, in, forcep) +#define sexp_maybe_unblock_port(ctx, in) +#define sexp_check_block_port(ctx, in, forcep) #endif #define SEXP_PORT_UNKNOWN_FLAGS -1uL diff --git a/main.c b/main.c index ee6d044c..073c64cc 100644 --- a/main.c +++ b/main.c @@ -86,9 +86,9 @@ static sexp check_exception (sexp ctx, sexp res) { } static sexp sexp_load_standard_repl_env (sexp ctx, sexp env, sexp k) { - sexp p, res = sexp_load_standard_env(ctx, env, k); + sexp res = sexp_load_standard_env(ctx, env, k); #if SEXP_USE_GREEN_THREADS - p = sexp_param_ref(ctx, env, sexp_global(ctx, SEXP_G_CUR_IN_SYMBOL)); + sexp p = sexp_param_ref(ctx, env, sexp_global(ctx, SEXP_G_CUR_IN_SYMBOL)); if (sexp_portp(p)) fcntl(sexp_port_fileno(p), F_SETFL, O_NONBLOCK); p = sexp_param_ref(ctx, env, sexp_global(ctx, SEXP_G_CUR_OUT_SYMBOL)); if (sexp_portp(p)) fcntl(sexp_port_fileno(p), F_SETFL, O_NONBLOCK); diff --git a/vm.c b/vm.c index b06ff59d..2a0c6f93 100644 --- a/vm.c +++ b/vm.c @@ -211,13 +211,13 @@ static void generate_opcode_app (sexp ctx, sexp app) { if (sexp_opcode_inverse(op)) { inv_default = 1; } else { - if (sexp_opcode_opt_param_p(op)) { + if (sexp_opcode_opt_param_p(op) && sexp_opcodep(sexp_opcode_data(op))) { #if SEXP_USE_GREEN_THREADS emit(ctx, SEXP_OP_PARAMETER_REF); emit_word(ctx, (sexp_uint_t)sexp_opcode_data(op)); bytecode_preserve(ctx, sexp_opcode_data(op)); #else - emit_push(ctx, sexp_opcode_data(op)); + emit_push(ctx, sexp_opcode_data(sexp_opcode_data(op))); #endif emit(ctx, SEXP_OP_CDR); } else { @@ -561,7 +561,7 @@ static int sexp_check_type(sexp ctx, sexp a, sexp b) { } #else #define sexp_fcall_return(x, i) \ - top -= i; _ARG1 = x; ip += s; sexp_check_exception(x); + top -= i; _ARG1 = x; ip += sizeof(sexp); sexp_check_exception(); #endif #if SEXP_USE_DEBUG_VM