From 1b50d709d28e4616b471146e1c61b3877d6a6eea Mon Sep 17 00:00:00 2001 From: Alex Shinn Date: Wed, 6 Apr 2011 01:27:33 +0900 Subject: [PATCH] allowing NULL arg to sexp_load_standard_env, updating to SEXP_SEVEN --- eval.c | 3 ++- main.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/eval.c b/eval.c index 3c7b65c0..0d642aeb 100644 --- a/eval.c +++ b/eval.c @@ -377,7 +377,7 @@ sexp sexp_make_eval_context (sexp ctx, sexp stack, sexp env, sexp_uint_t size, s if (!res || sexp_exceptionp(res)) return res; if (ctx) sexp_gc_preserve1(ctx, res); - sexp_context_env(res) = (env ? env : sexp_make_primitive_env(res, SEXP_FIVE)); + sexp_context_env(res) = (env ? env : sexp_make_primitive_env(res, SEXP_SEVEN)); sexp_context_bc(res) = sexp_alloc_bytecode(res, SEXP_INIT_BCODE_SIZE); sexp_bytecode_name(sexp_context_bc(res)) = SEXP_FALSE; sexp_bytecode_length(sexp_context_bc(res)) = SEXP_INIT_BCODE_SIZE; @@ -1656,6 +1656,7 @@ sexp sexp_load_standard_parameters (sexp ctx, sexp env) { sexp sexp_load_standard_env (sexp ctx, sexp e, sexp version) { sexp_gc_var3(op, tmp, sym); sexp_gc_preserve3(ctx, op, tmp, sym); + if (!e) e = sexp_context_env(ctx); sexp_load_standard_parameters(ctx, e); #if SEXP_USE_DL sexp_env_define(ctx, e, sym=sexp_intern(ctx, "*shared-object-extension*", -1), diff --git a/main.c b/main.c index 0588beca..4cdb8769 100644 --- a/main.c +++ b/main.c @@ -119,7 +119,7 @@ static sexp sexp_load_standard_repl_env (sexp ctx, sexp env, sexp k) { #define load_init() if (! init_loaded++) do { \ init_context(); \ - check_exception(ctx, sexp_load_standard_repl_env(ctx, env, SEXP_FIVE)); \ + check_exception(ctx, sexp_load_standard_repl_env(ctx, env, SEXP_SEVEN)); \ } while (0) void run_main (int argc, char **argv) {