continuation-marks: fix caching problem in continuations

Closes #1931
This commit is contained in:
Matthew Flatt 2018-01-18 12:46:26 -07:00
parent 8eb9285116
commit 0c35905270
2 changed files with 40 additions and 0 deletions

View File

@ -1009,6 +1009,44 @@
(err/rt-test (do-test bad-mark 5) exn:fail?)
(err/rt-test (do-test bad-mark-2 5) exn:fail?))
;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Check that caching works right for marks in continuations that
;; capture metacontinuations
(let ()
(define tag (make-continuation-prompt-tag 'tag))
(define comp-k
(call-with-continuation-prompt
(lambda ()
(with-continuation-mark
'key
'val
((call-with-composable-continuation
(lambda (k)
(lambda () k))
tag))))
tag))
(define k
(call-with-continuation-prompt
(lambda ()
(with-continuation-mark
'other-key
'other-val
(comp-k (lambda ()
(call/cc
(lambda (k)
(abort-current-continuation
tag
(lambda () k)))
tag)))))
tag))
(list
(continuation-mark-set->list (continuation-marks k) 'key)
(continuation-mark-set->list (continuation-marks k) 'key)))
;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(report-errs)

View File

@ -7846,6 +7846,7 @@ static Scheme_Object *continuation_marks(Scheme_Thread *p,
p = NULL;
econt = NULL;
cont = NULL;
top_cont = NULL;
break;
}
@ -7887,6 +7888,7 @@ static Scheme_Object *continuation_marks(Scheme_Thread *p,
p = NULL;
econt = NULL;
cont = NULL;
top_cont = NULL;
break;
} else {