1.0.28.65: fix compiling with *PROFILE-HASH-CACHE* set to T
[sbcl.git] / src / compiler / ir1tran-lambda.lisp
index 5bb387b..efe3a48 100644 (file)
     (compiler-error "The variable ~S occurs more than once in the lambda list."
                     name))
   (let ((kind (info :variable :kind name)))
-    (when (or (keywordp name) (eq kind :constant))
-      (compiler-error "The name of the lambda variable ~S is already in use to name a constant."
-                      name))
+    (cond ((or (keywordp name) (eq kind :constant))
+           (compiler-error "The name of the lambda variable ~S is already in use to name a constant."
+                           name))
+          ((eq :global kind)
+           (compiler-error "The name of the lambda variable ~S is already in use to name a global variable."
+                           name)))
     (cond ((eq kind :special)
            (let ((specvar (find-free-var name)))
              (make-lambda-var :%source-name name
                                           :maybe-add-debug-catch t
                                           :source-name name)))
              (assert-global-function-definition-type name res)
-             (setf (defined-fun-functional defined-fun-res) res)
+             (push res (defined-fun-functionals defined-fun-res))
              (unless (eq (defined-fun-inlinep defined-fun-res) :notinline)
                (substitute-leaf-if
                 (lambda (ref)
              (setf (gethash name *free-funs*) res)))
           ;; If *FREE-FUNS* has a previously converted definition
           ;; for this name, then blow it away and try again.
-          ((defined-fun-functional found)
+          ((defined-fun-functionals found)
            (remhash name *free-funs*)
            (get-defined-fun name))
           (t found))))