Summary

Invalid letrec usage hangs the compiler

Metadata

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

[2019-09-26 11:35:42 UTC] sjamaan changed status from assigned to closed

[2019-09-26 11:35:42 UTC] sjamaan set resolution to fixed