The fix is not to make LINE nodes when treeifying a procedure.
In the context of a treeified procedure, LINE nodes would create a cycle
that would leak memory unless the procedure is explicitly untreeified.
In the case where APPLY was given named slot templates (a body list),
APPLY creates an anoymous procedure and there's no good place in the
evaluator to untreeify it. In this case, some nodes were leaked.
This was a regression introduced by r1570, when an untreeify_line
was removed from the logic for treeifying a proceedure, following what
UCBLogo does. However, UCBLogo doesn't leak nodes because
it has a mark-and-sweep garbage collector that can handle cycles.
The new fix doesn't re-add the explicit untreeification. Instead, it
extracts a helper function from untreeify_line() that doesn't mark the
line as a TREE or create the cycle. To me, it makes more sense not to
create the cycle than to create a cycle then immediately undo that work.