Comment 4 for bug 681092

Revision history for this message
Alastair Bridgewater (alastair-bridgewater) wrote :

Paul, you are quite right, the problem is tail-calls, in this case tail-local-calls.

Attached is a first stab at a fix for this. It makes the specific test case in this bug function as expected, but is very likely to leave further problems in its wake. The first problem is that there is no guarantee that the new frame won't overwrite the stack slot containing the closure value. The second problem is that a tail-full-call that takes a d-x closure as an argument will also overwrite the stack slot. The only plausible solution to the second problem is to disallow tail-calls when there is a "live" d-x closure.