seanjensengrey / mosh-scheme

Automatically exported from code.google.com/p/mosh-scheme
Other
0 stars 0 forks source link

bad reordering of definitions in the body of LET #202

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Unpack the attached tarball.
2. Run "make mtest". 

What is the expected output? What do you see instead?
It should print:

one-1
one-2
one-3
two-1
two-2
two-3

It prints:

one-1
two-1
one-2
one-3
two-2
two-3

What version of the product are you using? On what operating system?
Mosh master branch b93e9bc3f8b3e3c150229e61dfc489bc4a94bf3f.  i686-pc-linux-gnu.

Please provide any additional information below.
The makefile has rules to run the tests with other R6 implementations.

Original issue reported on code.google.com by mrc....@gmail.com on 18 Apr 2011 at 7:27

Attachments:

GoogleCodeExporter commented 9 years ago
It's backend's letrec* implementation bug.
mosh bytecode compiler will erroneously re-order unused variable in letrec*.

So, following code will show this issue at every mosh variant 
(psyntax-mosh,nmosh,vanilla-mosh -- mosh without RnRS expander)

(let ()
  (letrec* (
            (one1 (begin (display "one-1") '11))
            (one2 (begin (display "one-2") '12))
            (one3 (begin (display "one-3") '13))
            (two1 (begin (display "two-1") '11))
            (two2 (begin (display "two-2") '12))
            (two3 (begin (display "two-3") '13)))
    (list one1 two1)))

Original comment by oku...@gmail.com on 18 Apr 2011 at 12:31

GoogleCodeExporter commented 9 years ago
Confirmed.

Original comment by hige...@gmail.com on 22 Apr 2011 at 1:52

GoogleCodeExporter commented 9 years ago

Original comment by oku...@gmail.com on 11 Sep 2011 at 3:52