Resetting debug fp on normal return from apply.

Fixes #145.  "Returned" exceptions in the default
repl still print as if they were raised.
This commit is contained in:
Alex Shinn 2012-08-19 22:58:05 +09:00
parent e562cc0be3
commit ca0244f58e
2 changed files with 2 additions and 0 deletions

1
sexp.c
View file

@ -457,6 +457,7 @@ sexp sexp_make_context (sexp ctx, size_t size, size_t max_size) {
sexp_context_name(res) = sexp_context_specific(res) = SEXP_FALSE;
sexp_context_saves(res) = NULL;
sexp_context_params(res) = SEXP_NULL;
sexp_context_last_fp(res) = 0;
sexp_context_tracep(res) = 0;
sexp_context_timeoutp(res) = 0;
sexp_context_tailp(res) = 1;

1
vm.c
View file

@ -2080,6 +2080,7 @@ sexp sexp_apply (sexp ctx, sexp proc, sexp args) {
fp = sexp_unbox_fixnum(stack[fp+3]);
break;
case SEXP_OP_DONE:
sexp_context_last_fp(ctx) = fp;
goto end_loop;
default:
sexp_raise("unknown opcode", sexp_list1(ctx, sexp_make_fixnum(*(ip-1))));