The fix was copied in from UCBLogo, but that fix leaks memory. The problem is that the code doesn't "re-treeify" a body node if the definition of a function changes in mid-execution, which could crash if the definition changed in a significant way for tree-ification (such going from undefined to defined, or changing the number of inputs).
UCBLogo "leaks" the tree-ificiation of the procedure, which is not a problem for UCBLogo, because it has true garbage collection. But this results in a very significant memory leak for FMSLogo. My stop-gap fix for this memory leak is to untree-ify the procedure after it is executed. Unfortunately, this means that the original bug still exists for functions that are tree-recursive (non-tail recursive) because once the inner call exits, the outer call becomes untree-ified and can no longer handle having a procedure change.
Since the current change reduces the scope of the bug, I am checking it in. I'm not sure what the final fix will be-it may either be a reference count on the tree-ification or simply to keep the tree-ification around for the lifetime of the procedure.