[Openmcl-devel] rest args are wrong in backtrace output

Timothy Moore moore at bricoworks.com
Fri May 20 15:02:05 UTC 2005


I've been trying to get to the bottom of a problem I've been having 
with openmcl and Slime. This is with the current non-bleeding edge CVS 
tree, but I had the same problem in 0.14.2. Basically, in a couple of 
places code walks the stack looking for arguments to a function. There 
is an assumption that the order is required, optional, rest, and pairs 
of keyword and key-supplied-p. Several functions do this, such as 
find-local-name in lib/backtrace.lisp and frame-supplied-args in 
lib/backtracce-lds.lisp. However, this order doesn't seem to be valid 
anymore:
1 > (defun foo (a b &rest c &key d e) (break) (list a b c d e))

FOO
1 > (foo 1 2 :d 3 :e 4)

 > Debug: Break
...
2 > (:f 4)

(F0600490) : 4 "FOO" 48
   0 A: 1 ("required")
   1 B: 2 ("required")
   2 D: 3 ("rest")
   3 : T ("keyword")
   4 E: 4 ("key-supplied-p")
   5 : T ("keyword")
   6 C: (:D 3 :E 4) ("key-supplied-p")

This wouldn't be too annoying -- at least the names are right -- but 
frame-supplied-args assumes that the rest argument is a list and cons 
stuff on the front of it, when in fact that value can be anything at 
all. This causes Slime to crash when it loops over the resulting 
improper list.

For my education, where does the compiler lay out a function's stack?

Tim




More information about the Openmcl-devel mailing list