Opened 4 weeks ago

Last modified 4 weeks ago

#1645 assigned defect

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 (5)

comment:1 Changed 4 weeks ago by sjamaan

Milestone: someday5.2

comment:2 Changed 4 weeks 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 4 weeks 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 4 weeks 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 4 weeks ago by felix winkelmann

Owner: set to felix winkelmann
Status: newassigned
Note: See TracTickets for help on using tickets.