From 0c1242d4b33bc78764989eb6ad2bee797708f8f7 Mon Sep 17 00:00:00 2001
From: ram <ram>
Date: Tue, 20 Nov 1990 17:42:13 +0000
Subject: [PATCH] Fixed handling of keywords with non-null constant defaults
 and supplied-p args.  This had been broken since the "optimization" of
 allowing normal defaulting of supplied-p args with constant defaults.

---
 compiler/ir1tran.lisp | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/compiler/ir1tran.lisp b/compiler/ir1tran.lisp
index 703acc654..9eaecb252 100644
--- a/compiler/ir1tran.lisp
+++ b/compiler/ir1tran.lisp
@@ -1202,15 +1202,15 @@
 		     (keyword (arg-info-keyword info))
 		     (supplied-p (arg-info-supplied-p info))
 		     (n-value (gensym)))
+		(temps `(,n-value ,default))
 		(cond (supplied-p
 		       (let ((n-supplied (gensym)))
-			 (temps n-value n-supplied)
+			 (temps n-supplied)
 			 (arg-vals n-value n-supplied)
 			 (tests `((eq ,n-key ,keyword)
 				  (setq ,n-supplied t)
 				  (setq ,n-value ,n-value-temp)))))
 		      (t
-		       (temps `(,n-value ,default))
 		       (arg-vals n-value)
 		       (tests `((eq ,n-key ,keyword)
 				(setq ,n-value ,n-value-temp)))))))
@@ -1306,13 +1306,14 @@
 		      (supplied-temp (make-lambda-var :name n-supplied)))
 		 (unless supplied-p
 		   (setf (arg-info-supplied-p info) supplied-temp))
-		 (setf (arg-info-default info) nil)
+		 (when hairy-default
+		   (setf (arg-info-default info) nil))
 		 (main-vars supplied-temp)
 		 (cond (hairy-default
 			(main-vals nil nil)
 			(bind-vals `(if ,n-supplied ,n-val ,default)))
 		       (t
-			(main-vals (arg-info-default info) nil)
+			(main-vals default nil)
 			(bind-vals n-val)))
 		 (when supplied-p
 		   (bind-vars supplied-p)
-- 
GitLab