simplifying sexp_check_exception in vm

This commit is contained in:
Alex Shinn 2010-08-15 17:28:21 +09:00
parent 4bd9c0a3a7
commit ec8b976564

6
vm.c
View file

@ -486,8 +486,6 @@ static sexp_uint_t sexp_restore_stack (sexp saved, sexp *current) {
#define sexp_check_exception() \ #define sexp_check_exception() \
do {if (sexp_exceptionp(_ARG1)) { \ do {if (sexp_exceptionp(_ARG1)) { \
if (! sexp_exception_procedure(_ARG1)) \
sexp_exception_procedure(_ARG1) = self; \
goto call_error_handler;}} \ goto call_error_handler;}} \
while (0) while (0)
@ -550,8 +548,10 @@ sexp sexp_vm (sexp ctx, sexp proc) {
switch (*ip++) { switch (*ip++) {
case SEXP_OP_NOOP: case SEXP_OP_NOOP:
break; break;
case SEXP_OP_RAISE:
call_error_handler: call_error_handler:
if (! sexp_exception_procedure(_ARG1))
sexp_exception_procedure(_ARG1) = self;
case SEXP_OP_RAISE:
tmp1 = sexp_cdr(sexp_global(ctx, SEXP_G_ERR_HANDLER)); tmp1 = sexp_cdr(sexp_global(ctx, SEXP_G_ERR_HANDLER));
sexp_context_last_fp(ctx) = fp; sexp_context_last_fp(ctx) = fp;
if (! sexp_procedurep(tmp1)) goto end_loop; if (! sexp_procedurep(tmp1)) goto end_loop;