[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
kcl bug
Consider the following function:
(DEFUN FOO (&OPTIONAL (A NIL B) &REST C) (LIST A B C))
When (FOO 'X 'Y 'Z) is called uncompiled, it correctly returns (X T (Y Z)).
However, when called compiled, (FOO 'X 'Y 'Z) returns (X (T) (Y T)).
Apparently, the run-time stack begins as:
-------------
| X | Y | Z |
-------------
It seems that the compiler uses the same space on their run-time stack
for Z and the value supplied for the supplied-p parameter -- B. That
same location is used in part of the conversion of the &REST arguments
into a list. Therefore, after handling B, the stack becomes:
-------------
| X | Y | T |
-------------
Then, in order to handle conversion of the &REST arguments, the stack
becomes:
-------------------------
| X | (Y T) | (T) | NIL |
-------------------------
Elia Weixelbaum