Summary
Invalid letrec usage hangs the compiler
Metadata
- Id: abd96054d8f4b1297a12ecb6fa61ec1fe23b12f0
- Trac id: 1645
- Type: defect
- Reporter: megane
- Owner: felix
- Cc:
- Status: closed
- Component: unknown
- Estimated difficulty:
- Resolution: fixed
- Priority: minor
- Milestone: 5.2
- Version: 5.1.0
- Changetime: 2019-09-26 11:35:42 UTC
- Created: 2019-08-26 08:12:33 UTC
- Keywords:
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.
Changes and comments
[2019-08-26 08:39:44 UTC] sjamaan changed milestone from someday to 5.2
[2019-08-26 12:52:19 UTC] felix wrote:
The optimizer wants to replace x by itself here (`replace-var` in `walk1` in `perform-high-level-optimizations`). See also: http://paste.call-cc.org/paste?id=2ff240f68a0b2689b7ee71d37d10dc75227339fc
That "x10" is replacable by "x911" seems strange...
[2019-08-26 13:25:12 UTC] sjamaan wrote:
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)
[2019-08-26 14:30:09 UTC] felix wrote:
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.
[2019-08-26 16:54:19 UTC] felix changed status from new to assigned
[2019-08-26 16:54:19 UTC] felix set owner to felix
[2019-09-26 11:35:42 UTC] sjamaan wrote:
Fixed with 0ca0af94d12c08a041258e5fba32c20569b1cbac