1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-24 20:30:28 +02:00

$primcall always continues to $kargs

* module/language/cps/devirtualize-integers.scm (peel-trace): Update
  comment.
* module/language/cps/contification.scm (apply-contification): Update to
  never contify a return of $primcall to $kreceive.
* module/language/cps/verify.scm (check-arities): Require that primcalls
  continue to $kargs.
This commit is contained in:
Andy Wingo 2018-01-03 21:23:51 +01:00
parent 8248649966
commit 118f516a8b
3 changed files with 6 additions and 15 deletions

View file

@ -413,19 +413,14 @@ function set."
(let ((k* (lookup-return-cont k)))
(if (eq? k k*)
(with-cps cps (build-term ($continue k src ,exp)))
;; We are contifying this return. It must be a call, a
;; $primcall that can continue to $ktail (basically this is
;; only "throw" and friends), or a $values expression. k*
;; will be either a $ktail or a $kreceive continuation.
;; We are contifying this return. It must be a call or a
;; $values expression. k* will be either a $ktail or a
;; $kreceive continuation.
(match (intmap-ref conts k*)
(($ $kreceive ($ $arity req () rest () #f) kargs)
(match exp
(($ $call)
(with-cps cps (build-term ($continue k* src ,exp))))
;; A primcall that can continue to $ktail can also
;; continue to $kreceive.
(($ $primcall)
(with-cps cps (build-term ($continue k* src ,exp))))
;; We need to punch through the $kreceive; otherwise we'd
;; have to rewrite as a call to the 'values primitive.
(($ $values vals)