#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:


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 11 months ago by sjamaan

Milestone: someday5.2

comment:2 Changed 11 months ago by felix winkelmann

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...

comment:3 Changed 11 months ago by sjamaan

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 11 months ago by felix winkelmann

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 11 months ago by felix winkelmann

Owner: set to felix winkelmann
Status: newassigned

comment:6 Changed 10 months ago by sjamaan

Resolution: fixed
Status: assignedclosed

Fixed with 0ca0af94d12c08a041258e5fba32c20569b1cbac

Note: See TracTickets for help on using tickets.