Subject: bug#54478: unwanted source references

From: Matt Wette <[email-masked]>
Date: Sun, 27 Mar 2022 07:27:30 -0700

I think the error is in use of "src" arg to make-seq in the following loop,
in ice-9/psyntax.scm, starting at line 1633:

                 (let lp ((var-ids var-ids) (vars vars) (vals vals)
                          (tail (expand-tail-expr)))
                   (cond
                    ((null? var-ids) tail)
                    ((not (car var-ids))
                     (lp (cdr var-ids) (cdr vars) (cdr vals)
                         (make-seq src ((car vals)) tail)))
                    (else
                     (let ((var-ids (map (lambda (id)
                                           (if id (syntax->datum id) '_))
                                         (reverse var-ids)))
                           (vars (map (lambda (var) (or var (gen-label)))
                                      (reverse vars)))
                           (vals (map (lambda (expand-expr id)
                                        (if id
                                            (expand-expr)
                                            (make-seq src
                                                      (expand-expr)
                                                      (build-void src))))
                                      (reverse vals) (reverse var-ids))))
                       (build-letrec src #t var-ids vars vals tail)))))