X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcompiler%2Fconstantp.lisp;h=d06d22661e7b33b4f739f230f987616cf61656ef;hb=74cf7a4d01664fbf72a662ba093ad67ca243b524;hp=85bb5b8f5f9f6037e31ab0446270875584d4831a;hpb=faafcfc8d751c0f549f8d30ff2ea4bc7342a7329;p=sbcl.git diff --git a/src/compiler/constantp.lisp b/src/compiler/constantp.lisp index 85bb5b8..d06d226 100644 --- a/src/compiler/constantp.lisp +++ b/src/compiler/constantp.lisp @@ -29,7 +29,7 @@ (defun %constantp (form environment envp) (let ((form (if envp - (sb!xc:macroexpand form environment) + (%macroexpand form environment) form))) (typecase form ;; This INFO test catches KEYWORDs as well as explicitly @@ -45,11 +45,23 @@ (defun %constant-form-value (form environment envp) (let ((form (if envp - (sb!xc:macroexpand form environment) + (%macroexpand form environment) form))) (typecase form (symbol - (symbol-value form)) + ;; KLUDGE: superficially, this might look good enough: we grab + ;; the value from the info database, and if it isn't there (or + ;; is NIL, but hey) we use the host's value. This works for + ;; MOST-POSITIVE-FIXNUM and friends, but still fails for + ;; float-related constants, where there is in fact no guarantee + ;; that we can represent our target value at all in the host, + ;; so we don't try. We should rework all uses of floating + ;; point so that we never try to use a host's value, and then + ;; make some kind of assertion that we never attempt to take + ;; a host value of a constant in the CL package. + #+sb-xc-host (or (info :variable :xc-constant-value form) + (symbol-value form)) + #-sb-xc-host (symbol-value form)) (list (if (special-operator-p (car form)) (constant-special-form-value form environment envp)