From 1bf5fda86947efa56cb4e42fb34fe28bc401a113 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Wed, 24 Oct 2012 13:04:35 -0700 Subject: [PATCH] fix `chaperone-prompt-tag' --- collects/tests/racket/prompt.rktl | 22 ++++++++++++++++++++++ src/racket/src/fun.c | 2 +- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/collects/tests/racket/prompt.rktl b/collects/tests/racket/prompt.rktl index aa77227f8d..f4028a6b91 100644 --- a/collects/tests/racket/prompt.rktl +++ b/collects/tests/racket/prompt.rktl @@ -323,6 +323,28 @@ values (lambda (s) (string-append s "x"))))) +;; ---------------------------------------- +;; check that cc proc doesn't break abort proc + +(let () + (define l null) + + (define cpt + (chaperone-prompt-tag + (make-continuation-prompt-tag) + (λ (x) (set! l (cons "ho" l)) x) + (λ (x) (set! l (cons "hi" l)) x) + ;; commented out intentionally, see below + (λ (x) x))) + + (call-with-continuation-prompt + (λ () + (abort-current-continuation cpt 5)) + cpt + (λ (x) (+ 1 x))) + + (test '("ho" "hi") values l)) + ;; ---------------------------------------- ;; Check that when a continuation includes a continuation ;; application, that a captured requirement to apply a diff --git a/src/racket/src/fun.c b/src/racket/src/fun.c index be759d02e9..ffa773d5f0 100644 --- a/src/racket/src/fun.c +++ b/src/racket/src/fun.c @@ -5800,7 +5800,7 @@ Scheme_Object *do_chaperone_prompt_tag (const char *name, int is_impersonator, i ppos = 5; } else ppos = 4; - redirects = scheme_make_pair(argv[1], redirects); + redirects = scheme_make_pair(argv[2], redirects); } else { ppos = 3; redirects = argv[2];