From 730a827d0e1900268cef1325b53a968f2474a41f Mon Sep 17 00:00:00 2001 From: Yuichi Nishiwaki Date: Sun, 27 Jul 2014 18:29:45 +0900 Subject: [PATCH 1/2] fix vm_tear_off is broken --- src/vm.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/vm.c b/src/vm.c index 1a48b16a..779ed138 100644 --- a/src/vm.c +++ b/src/vm.c @@ -495,14 +495,14 @@ vm_push_env(pic_state *pic) } static void -vm_tear_off(pic_state *pic) +vm_tear_off(pic_callinfo *ci) { struct pic_env *env; int i; - assert(pic->ci->env != NULL); + assert(ci->env != NULL); - env = pic->ci->env; + env = ci->env; if (env->regs == env->storage) { return; /* is torn off */ @@ -519,8 +519,8 @@ pic_vm_tear_off(pic_state *pic) pic_callinfo *ci; for (ci = pic->ci; ci > pic->cibase; ci--) { - if (pic->ci->env != NULL) { - vm_tear_off(pic); + if (ci->env != NULL) { + vm_tear_off(ci); } } } @@ -844,7 +844,7 @@ pic_apply(pic_state *pic, struct pic_proc *proc, pic_value argv) pic_callinfo *ci; if (pic->ci->env != NULL) { - vm_tear_off(pic); + vm_tear_off(pic->ci); } if (c.u.i == -1) { @@ -870,7 +870,7 @@ pic_apply(pic_state *pic, struct pic_proc *proc, pic_value argv) pic_callinfo *ci; if (pic->ci->env != NULL) { - vm_tear_off(pic); + vm_tear_off(pic->ci); } pic->ci->retc = c.u.i; From 87604a4cb83bab649aa389df017f0a45b9cf43c9 Mon Sep 17 00:00:00 2001 From: Yuichi Nishiwaki Date: Sun, 27 Jul 2014 18:32:04 +0900 Subject: [PATCH 2/2] unlock exception tests --- t/r7rs-tests.scm | 52 ++++++++++++++++++++++++------------------------ 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/t/r7rs-tests.scm b/t/r7rs-tests.scm index a9757218..d22acc7e 100644 --- a/t/r7rs-tests.scm +++ b/t/r7rs-tests.scm @@ -1627,10 +1627,10 @@ (test #t (error-object? (guard (exn (else exn)) (error "BOOM!" 1 2 3)))) -;; (test "BOOM!" -;; (error-object-message (guard (exn (else exn)) (error "BOOM!" 1 2 3)))) -;; (test '(1 2 3) -;; (error-object-irritants (guard (exn (else exn)) (error "BOOM!" 1 2 3)))) +(test "BOOM!" + (error-object-message (guard (exn (else exn)) (error "BOOM!" 1 2 3)))) +(test '(1 2 3) + (error-object-irritants (guard (exn (else exn)) (error "BOOM!" 1 2 3)))) (test #f (file-error? (guard (exn (else exn)) (error "BOOM!")))) @@ -1737,30 +1737,30 @@ (test "reraised 0!" (get-output-string out)) (test 'zero value)) -;; ;; From SRFI-34 "Examples" section - #8 -;; (test 42 -;; (guard (condition -;; ((assq 'a condition) => cdr) -;; ((assq 'b condition))) -;; (raise (list (cons 'a 42))))) +;; From SRFI-34 "Examples" section - #8 +(test 42 + (guard (condition + ((assq 'a condition) => cdr) + ((assq 'b condition))) + (raise (list (cons 'a 42))))) -;; ;; From SRFI-34 "Examples" section - #9 -;; (test '(b . 23) -;; (guard (condition -;; ((assq 'a condition) => cdr) -;; ((assq 'b condition))) -;; (raise (list (cons 'b 23))))) +;; From SRFI-34 "Examples" section - #9 +(test '(b . 23) + (guard (condition + ((assq 'a condition) => cdr) + ((assq 'b condition))) + (raise (list (cons 'b 23))))) -;; (test 'caught-d -;; (guard (condition -;; ((assq 'c condition) 'caught-c) -;; ((assq 'd condition) 'caught-d)) -;; (list -;; (sqrt 8) -;; (guard (condition -;; ((assq 'a condition) => cdr) -;; ((assq 'b condition))) -;; (raise (list (cons 'd 24))))))) +(test 'caught-d + (guard (condition + ((assq 'c condition) 'caught-c) + ((assq 'd condition) 'caught-d)) + (list + (sqrt 8) + (guard (condition + ((assq 'a condition) => cdr) + ((assq 'b condition))) + (raise (list (cons 'd 24))))))) (test-end)