Opened 6 years ago
Closed 6 years ago
#1645 closed defect (fixed)
Invalid letrec usage hangs the compiler
| Reported by: | megane | Owned by: | felix winkelmann |
|---|---|---|---|
| Priority: | minor | Milestone: | 5.2 |
| Component: | unknown | Version: | 5.1.0 |
| Keywords: | Cc: | ||
| Estimated difficulty: |
Description
This seems to throw the compiler into some kind of infinite recursion (letrec ((x x)) 1). Doesn't seem to happen in CHICKEN 4.
Change History (6)
comment:1 Changed 6 years ago by
| Milestone: | someday → 5.2 |
|---|
comment:2 Changed 6 years ago by
comment:3 Changed 6 years ago by
Megane said it does not hang in C4 but I see the same behaviour on 4.11.0. Only in the compiler, it does not fail in the interpreter (but same for C5)
comment:4 Changed 6 years ago by
Well, it isn't. The alpha-conversion takes care of scope, so the optimizer doesn't have to. So this has to be detected at an earlier stage, which also hopefully improves the error message.
comment:5 Changed 6 years ago by
| Owner: | set to felix winkelmann |
|---|---|
| Status: | new → assigned |
comment:6 Changed 6 years ago by
| Resolution: | → fixed |
|---|---|
| Status: | assigned → closed |
Fixed with 0ca0af94d12c08a041258e5fba32c20569b1cbac
Note: See
TracTickets for help on using
tickets.

The optimizer wants to replace x by itself here (
replace-varinwalk1inperform-high-level-optimizations). See also: http://paste.call-cc.org/paste?id=2ff240f68a0b2689b7ee71d37d10dc75227339fcThat "x10" is replacable by "x911" seems strange...