bug#43326: [3.0.x] Regression: Compilation error involving strings

Erik Dominikus <[email protected]>
Newsgroups gmane.lisp.guile.bugs
Message-ID <CAOopUjnPRTVqrdxce4MJxsRzvgzeU0SmP4r-zQUYqW3Zy6o7mQ@mail.gmail.com>
Dear author(s) of the Guile 3.0.x compiler,

Background: I would like to report a problem that I found while trying
to write a simple web server with get-string-n, sxml simple, and web
server.

I have traced and reduced the problem into the minimal example below.

Some tested versions:
- affected: 3.0.2 and 3.0.4
- not affected: 2.0.13

How to reproduce:
- Download the attached compile-error.scm into your working directory.
- Run in Bash: GUILE_AUTO_COMPILE=0 guile -s compile-error.scm

Expected result: #t

Actual result: #f

Thank you.

Best regards,

Erik
compile-error.scm (text/x-scheme, 361 B)
;; GUILE_AUTO_COMPILE=0 guile -s compile-error.scm
(define code '(lambda ()
                (define a (string #\x #\y))
                (define b (substring/shared a 0 1))
                (string-ref b 0)))
(define compiled (compile code))
(define interped (eval code (interaction-environment)))
(write (equal? (compiled) (interped))) ;; #\nul vs #\x
(newline)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.