1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-09 21:40:33 +02:00

Don't diverge when serializing cyclic lists during compilation

* module/language/glil/compile-assembly.scm (scheme-list?): Don't
  diverge when serializing cyclic lists.
This commit is contained in:
Mark H Weaver 2012-01-14 04:28:16 -05:00
parent 39eb0b7297
commit c5f6c2e47f

View file

@ -106,9 +106,11 @@
;; This tests for a proper scheme list whose last cdr is '(), not #nil.
;;
(define (scheme-list? x)
(or (eq? x '())
(and (pair? x)
(scheme-list? (cdr x)))))
(and (list? x)
(or (eq? x '())
(let ((p (last-pair x)))
(and (pair? p)
(eq? (cdr p) '()))))))
;; Note: in all of these procedures that build up constant tables, the
;; first (zeroth) index is reserved. At runtime it is replaced with the