GNU bug report logs -
#43326
[3.0.x] Regression: Compilation error involving strings
Previous Next
Full log
Message #8 received at submit <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
On Fri, Sep 11, 2020 at 03:31:24PM +0700, Erik Dominikus wrote:
> 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
> ;; 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)
Interesting: replacing "substring/shared" with just "substring" seems
to "fix" it (FWIW: the compiled version with "substring/shared" returns
"#\nul" (unexpected, for me), whereas the one with just "substring"
returns "#\x" (expected).
Cheers
- t
[signature.asc (application/pgp-signature, inline)]
This bug report was last modified 4 years and 276 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.