From ca0244f58e1822c25992c1477debf759a6f2b346 Mon Sep 17 00:00:00 2001 From: Alex Shinn Date: Sun, 19 Aug 2012 22:58:05 +0900 Subject: [PATCH] Resetting debug fp on normal return from apply. Fixes #145. "Returned" exceptions in the default repl still print as if they were raised. --- sexp.c | 1 + vm.c | 1 + 2 files changed, 2 insertions(+) diff --git a/sexp.c b/sexp.c index eabd4c61..b8395b36 100644 --- a/sexp.c +++ b/sexp.c @@ -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; diff --git a/vm.c b/vm.c index a1cbf86b..9c243201 100644 --- a/vm.c +++ b/vm.c @@ -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))));